summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/storage/buffer/localbuf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/storage/buffer/localbuf.c b/src/backend/storage/buffer/localbuf.c
index 567b8d15ef0..55953c3e3e8 100644
--- a/src/backend/storage/buffer/localbuf.c
+++ b/src/backend/storage/buffer/localbuf.c
@@ -377,7 +377,7 @@ ExtendBufferedRelLocal(BufferManagerRelation bmr,
hash_search(LocalBufHash, (void *) &tag, HASH_ENTER, &found);
if (found)
{
- BufferDesc *existing_hdr = GetLocalBufferDescriptor(hresult->id);
+ BufferDesc *existing_hdr;
uint32 buf_state;
UnpinLocalBuffer(BufferDescriptorGetBuffer(victim_buf_hdr));
@@ -389,7 +389,7 @@ ExtendBufferedRelLocal(BufferManagerRelation bmr,
buf_state = pg_atomic_read_u32(&existing_hdr->state);
Assert(buf_state & BM_TAG_VALID);
Assert(!(buf_state & BM_DIRTY));
- buf_state &= BM_VALID;
+ buf_state &= ~BM_VALID;
pg_atomic_unlocked_write_u32(&existing_hdr->state, buf_state);
}
else