Additional write barrier in AdvanceXLInsertBuffer().
authorJeff Davis <[email protected]>
Wed, 20 Dec 2023 01:35:54 +0000 (17:35 -0800)
committerJeff Davis <[email protected]>
Wed, 20 Dec 2023 01:35:54 +0000 (17:35 -0800)
commit766571be16598b401b5527208847145edc6be1f4
tree8b996fa24f62b557b285ff07123a1d7e79a56092
parentc3a8e2a7cb16d55e3b757934b538cb8b8a0eab02
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
src/backend/access/transam/xlog.c