This question is about ClockSweepTick function and the code is below.
https://github.com/postgres/postgres/blob/24d2b2680a8d0e01b30ce8a41c4eb3b47aca5031/src/backend/storage/buffer/freelist.c#L146-L165
The value of expected, NBuffers, wrapped variable is fixed in the while
loop, so that when the v
Hi, Thank you for your quick reply
I misunderstood the logic of pg_atomic_compare_exchange_u32, so the loop
cannot be infinite.
> I wonder if we should make ->nextVictimBuffer a 64bit atomic. At the time
the changes went in we didn't (or rather, couldn't) rely on it, but these
days we could. I t