cranky-ConditionalLockBufferForCleanup.patch
text/x-patch
Filename: cranky-ConditionalLockBufferForCleanup.patch
Type: text/x-patch
Part: 1
Patch
Format: unified
| File | + | − |
|---|---|---|
| src/backend/storage/buffer/bufmgr.c | 3 | 0 |
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index f0f8d4259c..25f7327a82 100644
--- a/src/backend/storage/buffer/bufmgr.c
+++ b/src/backend/storage/buffer/bufmgr.c
@@ -58,6 +58,7 @@
#include "utils/resowner.h"
#include "utils/timestamp.h"
+#include "tcop/tcopprot.h"
/* Note: these two macros only work on shared buffers, not local ones! */
#define BufHdrGetBlock(bufHdr) ((Block) (BufferBlocks + ((Size) (bufHdr)->buf_id) * BLCKSZ))
@@ -5041,6 +5042,8 @@ ConditionalLockBufferForCleanup(Buffer buffer)
Assert(BufferIsValid(buffer));
+if (debug_query_string && (strcmp(debug_query_string, "VACUUM ANALYZE tenk2;") == 0) && (rand() % 100 == 0))
+{ elog(LOG, "!!!ConditionalLockBufferForCleanup() returning false"); return false; }
if (BufferIsLocal(buffer))
{
refcount = LocalRefCount[-buffer - 1];