mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-15 17:32:56 +00:00
clippy
This commit is contained in:
@@ -785,21 +785,19 @@ impl WalIngest {
|
||||
}
|
||||
(new, old) => {
|
||||
// Emit one record per VM block that needs updating.
|
||||
for update in [new, old] {
|
||||
if let Some((heap_blkno, vm_blk)) = update {
|
||||
self.put_rel_wal_record(
|
||||
modification,
|
||||
vm_rel,
|
||||
vm_blk,
|
||||
NeonWalRecord::ClearVisibilityMapFlags {
|
||||
heap_blkno_1: Some(heap_blkno),
|
||||
heap_blkno_2: None,
|
||||
flags,
|
||||
},
|
||||
ctx,
|
||||
)
|
||||
.await?;
|
||||
}
|
||||
for (heap_blkno, vm_blk) in [new, old].into_iter().flatten() {
|
||||
self.put_rel_wal_record(
|
||||
modification,
|
||||
vm_rel,
|
||||
vm_blk,
|
||||
NeonWalRecord::ClearVisibilityMapFlags {
|
||||
heap_blkno_1: Some(heap_blkno),
|
||||
heap_blkno_2: None,
|
||||
flags,
|
||||
},
|
||||
ctx,
|
||||
)
|
||||
.await?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -414,22 +414,20 @@ impl PostgresRedoManager {
|
||||
"ClearVisibilityMapFlags record on unexpected rel {}",
|
||||
rel
|
||||
);
|
||||
for update in [heap_blkno_1, heap_blkno_2] {
|
||||
if let Some(heap_blkno) = update {
|
||||
let heap_blkno = *heap_blkno;
|
||||
// Calculate the VM block and offset that corresponds to the heap block.
|
||||
let map_block = pg_constants::HEAPBLK_TO_MAPBLOCK(heap_blkno);
|
||||
let map_byte = pg_constants::HEAPBLK_TO_MAPBYTE(heap_blkno);
|
||||
let map_offset = pg_constants::HEAPBLK_TO_OFFSET(heap_blkno);
|
||||
for heap_blkno in [heap_blkno_1, heap_blkno_2].into_iter().flatten() {
|
||||
let heap_blkno = *heap_blkno;
|
||||
// Calculate the VM block and offset that corresponds to the heap block.
|
||||
let map_block = pg_constants::HEAPBLK_TO_MAPBLOCK(heap_blkno);
|
||||
let map_byte = pg_constants::HEAPBLK_TO_MAPBYTE(heap_blkno);
|
||||
let map_offset = pg_constants::HEAPBLK_TO_OFFSET(heap_blkno);
|
||||
|
||||
// Check that we're modifying the correct VM block.
|
||||
assert!(map_block == blknum);
|
||||
// Check that we're modifying the correct VM block.
|
||||
assert!(map_block == blknum);
|
||||
|
||||
// equivalent to PageGetContents(page)
|
||||
let map = &mut page[pg_constants::MAXALIGN_SIZE_OF_PAGE_HEADER_DATA..];
|
||||
// equivalent to PageGetContents(page)
|
||||
let map = &mut page[pg_constants::MAXALIGN_SIZE_OF_PAGE_HEADER_DATA..];
|
||||
|
||||
map[map_byte as usize] &= !(flags << map_offset);
|
||||
}
|
||||
map[map_byte as usize] &= !(flags << map_offset);
|
||||
}
|
||||
}
|
||||
// Non-relational WAL records are handled here, with custom code that has the
|
||||
|
||||
Reference in New Issue
Block a user