Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f83d709

Browse files
committed
Merge prune, freeze and vacuum WAL record formats
The new combined WAL record is now used for pruning, freezing and 2nd pass of vacuum. This is in preparation for changing VACUUM to write a combined prune+freeze record per page, instead of separate two records. The new WAL record format now supports that, but the code still always writes separate records for pruning and freezing. This reserves separate XLOG_HEAP2_* info codes for when the pruning record is emitted for on-access pruning or VACUUM, per Peter Geoghegan's suggestion. The record format is identical, but having separate info codes makes it easier analyze pruning and vacuuming with pg_waldump. The function to emit the new WAL record, log_heap_prune_and_freeze(), is in pruneheap.c. The existing heap_log_freeze_plan() and its subroutines are moved to pruneheap.c without changes, to keep them together with log_heap_prune_and_freeze(). Author: Melanie Plageman <melanieplageman@gmail.com> Discussion: https://www.postgresql.org/message-id/CAAKRu_azf-zH%3DDgVbquZ3tFWjMY1w5pO8m-TXJaMdri8z3933g@mail.gmail.com Discussion: https://www.postgresql.org/message-id/CAAKRu_b2oE4GL%3Dq4g9mcByS9yT7wTQvEH9OLpabj28e%2BWKFi2A@mail.gmail.com
1 parent d44032d commit f83d709

File tree

11 files changed

+805
-600
lines changed

11 files changed

+805
-600
lines changed

src/backend/access/gist/gistxlog.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,10 @@ gistRedoDeleteRecord(XLogReaderState *record)
183183
*
184184
* GiST delete records can conflict with standby queries. You might think
185185
* that vacuum records would conflict as well, but we've handled that
186-
* already. XLOG_HEAP2_PRUNE records provide the highest xid cleaned by
187-
* the vacuum of the heap and so we can resolve any conflicts just once
188-
* when that arrives. After that we know that no conflicts exist from
189-
* individual gist vacuum records on that index.
186+
* already. XLOG_HEAP2_PRUNE_VACUUM_SCAN records provide the highest xid
187+
* cleaned by the vacuum of the heap and so we can resolve any conflicts
188+
* just once when that arrives. After that we know that no conflicts
189+
* exist from individual gist vacuum records on that index.
190190
*/
191191
if (InHotStandby)
192192
{

src/backend/access/hash/hash_xlog.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -992,10 +992,11 @@ hash_xlog_vacuum_one_page(XLogReaderState *record)
992992
* Hash index records that are marked as LP_DEAD and being removed during
993993
* hash index tuple insertion can conflict with standby queries. You might
994994
* think that vacuum records would conflict as well, but we've handled
995-
* that already. XLOG_HEAP2_PRUNE records provide the highest xid cleaned
996-
* by the vacuum of the heap and so we can resolve any conflicts just once
997-
* when that arrives. After that we know that no conflicts exist from
998-
* individual hash index vacuum records on that index.
995+
* that already. XLOG_HEAP2_PRUNE_VACUUM_SCAN records provide the highest
996+
* xid cleaned by the vacuum of the heap and so we can resolve any
997+
* conflicts just once when that arrives. After that we know that no
998+
* conflicts exist from individual hash index vacuum records on that
999+
* index.
9991000
*/
10001001
if (InHotStandby)
10011002
{

0 commit comments

Comments
 (0)