use-atomic-add-for-increment-counter.patch

application/octet-stream

Filename: use-atomic-add-for-increment-counter.patch
Type: application/octet-stream
Part: 0
Message: Xlogprefetcher: Use atomic add for increment counter

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: unified
File+
src/backend/access/transam/xlogprefetcher.c 1 1
diff --git a/src/backend/access/transam/xlogprefetcher.c b/src/backend/access/transam/xlogprefetcher.c
index ed3aacabc9..3dbd4925bd 100644
--- a/src/backend/access/transam/xlogprefetcher.c
+++ b/src/backend/access/transam/xlogprefetcher.c
@@ -351,7 +351,7 @@ static inline void
 XLogPrefetchIncrement(pg_atomic_uint64 *counter)
 {
 	Assert(AmStartupProcess() || !IsUnderPostmaster);
-	pg_atomic_write_u64(counter, pg_atomic_read_u64(counter) + 1);
+	pg_atomic_fetch_add_u64(counter, 1);
 }
 
 /*