Re: SimpleLruTruncate() mutual exclusion
Noah Misch <noah@leadboat.com>
From: Noah Misch <noah@leadboat.com>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2019-11-04T23:43:09Z
Lists: pgsql-hackers
On Mon, Nov 04, 2019 at 03:26:35PM +1300, Thomas Munro wrote: > On Thu, Aug 1, 2019 at 6:51 PM Noah Misch <noah@leadboat.com> wrote: > > vac_truncate_clog() instance 1 starts, considers segment ABCD eligible to unlink > > vac_truncate_clog() instance 2 starts, considers segment ABCD eligible to unlink > > vac_truncate_clog() instance 1 unlinks segment ABCD > > vac_truncate_clog() instance 1 calls SetTransactionIdLimit() > > vac_truncate_clog() instance 1 finishes > > some backend calls SimpleLruZeroPage(), creating segment ABCD > > vac_truncate_clog() instance 2 unlinks segment ABCD > > > > Serializing vac_truncate_clog() fixes that. > > I've wondered before (in a -bugs thread[1] about unexplained pg_serial > wraparound warnings) if we could map 64 bit xids to wide SLRU file > names that never wrap around and make this class of problem go away. > Unfortunately multixacts would need 64 bit support too... > > [1] https://www.postgresql.org/message-id/flat/CAEBTBzuS-01t12GGVD6qCezce8EFD8aZ1V%2Bo_3BZ%3DbuVLQBtRg%40mail.gmail.com That change sounds good to me.
Commits
-
Prevent concurrent SimpleLruTruncate() for any given SLRU.
- e525770dd504 10.15 landed
- d4031d78460c 11.10 landed
- 5ae01df6f6ef 9.6.20 landed
- 3fbbf64ceecb 9.5.24 landed
- 592a589a04bd 13.0 landed
- 30e68a2abb38 12.5 landed
- 566372b3d643 14.0 landed
-
Rename SLRU structures and associated LWLocks.
- 5da14938f7bf 13.0 cited
-
Improve ANALYZE's handling of concurrent-update scenarios.
- 7170268efd51 12.0 cited
-
Avoid consuming an XID during vac_truncate_clog().
- 996d273978c6 9.6.0 cited