From 8e04de6ef9a06351b26f8b354dfa18ce309ca38d Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Thu, 4 Jan 2024 12:36:35 +0000 Subject: [PATCH] fixup 'restructure match block to make the special case clear' --- pageserver/src/walingest.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pageserver/src/walingest.rs b/pageserver/src/walingest.rs index 277475c02a..f6e9b35441 100644 --- a/pageserver/src/walingest.rs +++ b/pageserver/src/walingest.rs @@ -747,19 +747,18 @@ impl WalIngest { (None, None) => { // Nothing to do } - (Some(x), Some(y)) if x == y => { + (Some((new_heap_blkno, new_vm_blk)), Some((old_heap_blkno, old_vm_blk))) + if new_vm_blk == old_vm_blk => + { // An UPDATE record that needs to clear the bits for both old and the // new page, both of which reside on the same VM page. - // - // Save some space by only putting one wal record. - let (heap_blk, vm_blk) = x; // could be x or y, doesn't matter self.put_rel_wal_record( modification, vm_rel, - vm_blk, + new_vm_blk, // could also be old_vm_blk, they're the same NeonWalRecord::ClearVisibilityMapFlags { - new_heap_blkno: Some(heap_blk), - old_heap_blkno: Some(heap_blk), + new_heap_blkno: Some(new_heap_blkno), + old_heap_blkno: Some(old_heap_blkno), flags, }, ctx,