Additional write barrier in AdvanceXLInsertBuffer().

Jeff Davis <jdavis@postgresql.org>

Commit: 766571be16598b401b5527208847145edc6be1f4
Author: Jeff Davis <jdavis@postgresql.org>
Date: 2023-12-20T01:35:54Z
Releases: 17.0
Additional write barrier in AdvanceXLInsertBuffer().

First, mark the xlblocks member with InvalidXLogRecPtr, then issue a
write barrier, then initialize it. That ensures that the xlblocks
member doesn't appear valid while the contents are being initialized.

In preparation for reading WAL buffer contents without a lock.

Author: Bharath Rupireddy
Discussion: https://postgr.es/m/CALj2ACVfFMfqD5oLzZSQQZWfXiJqd-NdX0_317veP6FuB31QWA@mail.gmail.com
Reviewed-by: Andres Freund

Files

PathChange+/−
src/backend/access/transam/xlog.c modified +8 −0

Discussion