Hi! Very interesting cases!
> On 20 Mar 2026, at 06:32, Alexey Makhmutov <[email protected]> wrote: > > Attached are separate patches, which tries to fixes both these problems – > calling ‘MarkBufferDirty’ instead of ‘MarkBufferDirtyHint’ in the first case > and replacing ‘PageGetFreeSpace’ with ‘PageGetHeapFreeSpace’ in the second > case. Patch 0001 - MarkBufferDirty() instead of MarkBufferDirtyHint() in XLogRecordPageWithFreeSpace(). Yes, MarkBufferDirtyHint() is no-op in recovery and it's the only case I found of using MarkBufferDirtyHint() in redo. Originally in e981653 was used MarkBufferDirty() but 96ef3b8 flipped to MarkBufferDirtyHint(). Neither of these commits provided a comment on why this version was chosen. I think if we fix it we must comment things. Patch 0002 - PageGetHeapFreeSpace instead of PageGetFreeSpace in heap_xlog_visible. This seems to be just an oversight in ab7dbd6. Every other call to XLogRecordPageWithFreeSpace() uses PageGetHeapFreeSpace(). And this seems correct to me, but a bit odd. Why indexes do not update FSM via this routine? It seems indexes do not log free pages at all, relying on index vacuum to rebuild fsm on Standby. Nice catch! Best regards, Andrey Borodin.
