agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
pgsql: Avoid replay cleanup locks for freeze-only and VM-only records
4+ messages / 1 participants
[nested] [flat]

* pgsql: Avoid replay cleanup locks for freeze-only and VM-only records
@ 2026-09-22 22:23  Melanie Plageman <melanieplageman@gmail.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Melanie Plageman @ 2026-09-22 22:23 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid replay cleanup locks for freeze-only and VM-only records

6dbb490261a combined pruning and freezing in a single WAL record but
unconditionally requested a cleanup lock during replay. Prior to version
17, freeze-only records were replayed under an ordinary exclusive lock.

1252a4ee286 subsequently folded visibility map updates into the same
records, extending the unnecessary cleanup-lock requirement to VM-only
updates starting in version 19.

Request a cleanup lock in redo only when the record actually prunes.
Freezing and visibility updates do not move or remove tuple storage, so
they need not wait for other buffer pins to be released. This avoids
unnecessary replay delays and cancellation of standby queries holding
buffer pins.

The fix is the same for all versions, though it addresses two oversights
in master/19 and one in 18/17.

Reported-by: Satyanarayana Narlapuram <satyanarlapuram@gmail.com>
Reported-by: Andrey Borodin <x4mmm@yandex-team.ru>
Reviewed-by: Andrey Borodin <x4mmm@yandex-team.ru>
Discussion: https://postgr.es/m/85b6968b-49f2-4243-86a6-9b4116e6439b@iki.fi
Discussion: https://postgr.es/m/CAHg+QDf3NcB3vOAqQ5EFcV5DYYUZ9snCSJAU-x1JDbtcjK3eBQ@mail.gmail.com
Discussion: https://postgr.es/m/F9BF304E-1298-481C-829A-B4E10AED025A@yandex-team.ru
Backpatch-through: 17

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/07c73f45063f6fcdc7f460aec84396ae4e0f71c5

Modified Files
--------------
src/backend/access/heap/pruneheap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Avoid replay cleanup locks for freeze-only and VM-only records
@ 2026-09-22 22:26  Melanie Plageman <melanieplageman@gmail.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Melanie Plageman @ 2026-09-22 22:26 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid replay cleanup locks for freeze-only and VM-only records

6dbb490261a combined pruning and freezing in a single WAL record but
unconditionally requested a cleanup lock during replay. Prior to version
17, freeze-only records were replayed under an ordinary exclusive lock.

1252a4ee286 subsequently folded visibility map updates into the same
records, extending the unnecessary cleanup-lock requirement to VM-only
updates starting in version 19.

Request a cleanup lock in redo only when the record actually prunes.
Freezing and visibility updates do not move or remove tuple storage, so
they need not wait for other buffer pins to be released. This avoids
unnecessary replay delays and cancellation of standby queries holding
buffer pins.

The fix is the same for all versions, though it addresses two oversights
in master/19 and one in 18/17.

Reported-by: Satyanarayana Narlapuram <satyanarlapuram@gmail.com>
Reported-by: Andrey Borodin <x4mmm@yandex-team.ru>
Reviewed-by: Andrey Borodin <x4mmm@yandex-team.ru>
Discussion: https://postgr.es/m/85b6968b-49f2-4243-86a6-9b4116e6439b@iki.fi
Discussion: https://postgr.es/m/CAHg+QDf3NcB3vOAqQ5EFcV5DYYUZ9snCSJAU-x1JDbtcjK3eBQ@mail.gmail.com
Discussion: https://postgr.es/m/F9BF304E-1298-481C-829A-B4E10AED025A@yandex-team.ru
Backpatch-through: 17

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/1139b7effdd3573406c52f1e9c5c3b59cdfbc43e

Modified Files
--------------
src/backend/access/heap/pruneheap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Avoid replay cleanup locks for freeze-only and VM-only records
@ 2026-09-22 22:30  Melanie Plageman <melanieplageman@gmail.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Melanie Plageman @ 2026-09-22 22:30 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid replay cleanup locks for freeze-only and VM-only records

6dbb490261a combined pruning and freezing in a single WAL record but
unconditionally requested a cleanup lock during replay. Prior to version
17, freeze-only records were replayed under an ordinary exclusive lock.

1252a4ee286 subsequently folded visibility map updates into the same
records, extending the unnecessary cleanup-lock requirement to VM-only
updates starting in version 19.

Request a cleanup lock in redo only when the record actually prunes.
Freezing and visibility updates do not move or remove tuple storage, so
they need not wait for other buffer pins to be released. This avoids
unnecessary replay delays and cancellation of standby queries holding
buffer pins.

The fix is the same for all versions, though it addresses two oversights
in master/19 and one in 18/17.

Reported-by: Satyanarayana Narlapuram <satyanarlapuram@gmail.com>
Reported-by: Andrey Borodin <x4mmm@yandex-team.ru>
Reviewed-by: Andrey Borodin <x4mmm@yandex-team.ru>
Discussion: https://postgr.es/m/85b6968b-49f2-4243-86a6-9b4116e6439b@iki.fi
Discussion: https://postgr.es/m/CAHg+QDf3NcB3vOAqQ5EFcV5DYYUZ9snCSJAU-x1JDbtcjK3eBQ@mail.gmail.com
Discussion: https://postgr.es/m/F9BF304E-1298-481C-829A-B4E10AED025A@yandex-team.ru
Backpatch-through: 17

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9733eb9e8df78f97c2f90abb7373d7bed4c5a4b3

Modified Files
--------------
src/backend/access/heap/pruneheap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Avoid replay cleanup locks for freeze-only and VM-only records
@ 2026-09-22 22:33  Melanie Plageman <melanieplageman@gmail.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Melanie Plageman @ 2026-09-22 22:33 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid replay cleanup locks for freeze-only and VM-only records

6dbb490261a combined pruning and freezing in a single WAL record but
unconditionally requested a cleanup lock during replay. Prior to version
17, freeze-only records were replayed under an ordinary exclusive lock.

1252a4ee286 subsequently folded visibility map updates into the same
records, extending the unnecessary cleanup-lock requirement to VM-only
updates starting in version 19.

Request a cleanup lock in redo only when the record actually prunes.
Freezing and visibility updates do not move or remove tuple storage, so
they need not wait for other buffer pins to be released. This avoids
unnecessary replay delays and cancellation of standby queries holding
buffer pins.

The fix is the same for all versions, though it addresses two oversights
in master/19 and one in 18/17.

Reported-by: Satyanarayana Narlapuram <satyanarlapuram@gmail.com>
Reported-by: Andrey Borodin <x4mmm@yandex-team.ru>
Reviewed-by: Andrey Borodin <x4mmm@yandex-team.ru>
Discussion: https://postgr.es/m/85b6968b-49f2-4243-86a6-9b4116e6439b@iki.fi
Discussion: https://postgr.es/m/CAHg+QDf3NcB3vOAqQ5EFcV5DYYUZ9snCSJAU-x1JDbtcjK3eBQ@mail.gmail.com
Discussion: https://postgr.es/m/F9BF304E-1298-481C-829A-B4E10AED025A@yandex-team.ru
Backpatch-through: 17

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5897bd1d8d36cb45523d0ac20da734398b7e4b16

Modified Files
--------------
src/backend/access/heap/pruneheap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2026-09-22 22:33 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-09-22 22:23 pgsql: Avoid replay cleanup locks for freeze-only and VM-only records Melanie Plageman <melanieplageman@gmail.com>
2026-09-22 22:26 pgsql: Avoid replay cleanup locks for freeze-only and VM-only records Melanie Plageman <melanieplageman@gmail.com>
2026-09-22 22:30 pgsql: Avoid replay cleanup locks for freeze-only and VM-only records Melanie Plageman <melanieplageman@gmail.com>
2026-09-22 22:33 pgsql: Avoid replay cleanup locks for freeze-only and VM-only records Melanie Plageman <melanieplageman@gmail.com>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox