summaryrefslogtreecommitdiff
path: root/src/backend/storage/buffer/bufmgr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/storage/buffer/bufmgr.c')
-rw-r--r--src/backend/storage/buffer/bufmgr.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index ffaca5ee54d..5da121872f4 100644
--- a/src/backend/storage/buffer/bufmgr.c
+++ b/src/backend/storage/buffer/bufmgr.c
@@ -4895,8 +4895,21 @@ FlushRelationBuffers(Relation rel)
errcallback.previous = error_context_stack;
error_context_stack = &errcallback;
+ /* Make sure we can handle the pin */
+ ReservePrivateRefCountEntry();
+ ResourceOwnerEnlarge(CurrentResourceOwner);
+
+ /*
+ * Pin/upin mostly to make valgrind work, but it also seems
+ * like the right thing to do.
+ */
+ PinLocalBuffer(bufHdr, false);
+
+
FlushLocalBuffer(bufHdr, srel);
+ UnpinLocalBuffer(BufferDescriptorGetBuffer(bufHdr));
+
/* Pop the error context stack */
error_context_stack = errcallback.previous;
}