Is this a problem in GenericXLogFinish()?

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Is this a problem in GenericXLogFinish()?
Date: 2023-09-22 20:52:48
Message-ID: d2c31606e6bb9b83a02ed4835d65191b38d4ba12.camel@j-davis.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


src/backend/transam/README says:

...
4. Mark the shared buffer(s) as dirty with MarkBufferDirty(). (This 
must happen before the WAL record is inserted; see notes in 
SyncOneBuffer().)
...

But GenericXLogFinish() does this:

...
/* Insert xlog record */
lsn = XLogInsert(RM_GENERIC_ID, 0);

/* Set LSN and mark buffers dirty */
for (i = 0; i < MAX_GENERIC_XLOG_PAGES; i++)
{
PageData *pageData = &state->pages[i];

if (BufferIsInvalid(pageData->buffer))
continue;
PageSetLSN(BufferGetPage(pageData->buffer), lsn);
MarkBufferDirty(pageData->buffer);
}
END_CRIT_SECTION();

Am I missing something or is that a problem?

Regards,
Jeff Davis

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tristen Raab 2023-09-22 21:01:34 Re: Better help output for pgbench -I init_steps
Previous Message Jeff Davis 2023-09-22 20:05:34 Re: CREATE FUNCTION ... SEARCH { DEFAULT | SYSTEM | SESSION }