From 009e5d12451d3ba3e8e729a97b614a78af6aed10 Mon Sep 17 00:00:00 2001
From: ashu <ashu@localhost.localdomain>
Date: Thu, 16 Mar 2017 12:01:30 +0530
Subject: [PATCH] Allow WAL consistency tool to mask LH_PAGE_HAS_DEAD_TUPLES
 added as a part of 'Microvacuum support for Hash Index'.

---
 src/backend/access/hash/hash_xlog.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/backend/access/hash/hash_xlog.c b/src/backend/access/hash/hash_xlog.c
index 8647e8c..cabf0fd 100644
--- a/src/backend/access/hash/hash_xlog.c
+++ b/src/backend/access/hash/hash_xlog.c
@@ -1229,8 +1229,15 @@ hash_mask(char *pagedata, BlockNumber blkno)
 		/*
 		 * In hash bucket and overflow pages, it is possible to modify the
 		 * LP_FLAGS without emitting any WAL record. Hence, mask the line
-		 * pointer flags. See hashgettuple() for details.
+		 * pointer flags. See hashgettuple(), _hash_kill_items() for details.
 		 */
 		mask_lp_flags(page);
 	}
+
+	/*
+	 * It is possible that the hint bit LH_PAGE_HAS_DEAD_TUPLES may remain
+	 * unlogged. So, mask it. See _hash_kill_items(), MarkBufferDirtyHint()
+	 * for details.
+	 */
+	opaque->hasho_flag &= ~LH_PAGE_HAS_DEAD_TUPLES;
 }
-- 
1.8.3.1

