On Tue, Nov 18, 2025 at 8:46 PM Chao Li <li.evan.chao@gmail.com> wrote:
>
>
> When XLogNeedsFlush(lsn) is true, StrategyRejectBuffer returns false, thus no retry will happen, which is different
fromthe old logic, is that an intentional change?
No, this is a mistake. You are correct. I thought I had fixed this in
an earlier version, but somehow it is still like this.
I've gone with correcting it like this (in attached v8)
if (!XLogNeedsFlush(lsn))
return false;
/*
* Remove the dirty buffer from the ring; necessary to prevent an infinite
* loop if all ring members are dirty.
*/
strategy->buffers[strategy->current] = InvalidBuffer;
return true;
But perhaps the suggestion I think you made earlier is better, dunno
if (!XLogNeedsFlush(lsn))
{
/*
* Remove the dirty buffer from the ring; necessary to prevent
an infinite
* loop if all ring members are dirty.
*/
strategy->buffers[strategy->current] = InvalidBuffer;
return true;
}
return false;
- Melanie