fix_failure_for_cca.patch

application/x-patch

Filename: fix_failure_for_cca.patch
Type: application/x-patch
Part: 0
Message: Re: [CLOBBER_CACHE]Server crashed with segfault 11 while executing clusterdb

Patch

Format: unified
File+
src/backend/access/heap/rewriteheap.c 3 0
diff --git a/src/backend/access/heap/rewriteheap.c b/src/backend/access/heap/rewriteheap.c
index 8241ba8f312..b44343a0166 100644
--- a/src/backend/access/heap/rewriteheap.c
+++ b/src/backend/access/heap/rewriteheap.c
@@ -339,7 +339,10 @@ end_heap_rewrite(RewriteState state)
 	 * wrote before the checkpoint.
 	 */
 	if (RelationNeedsWAL(state->rs_new_rel))
+	{
+		RelationOpenSmgr(state->rs_new_rel);
 		smgrimmedsync(state->rs_new_rel->rd_smgr, MAIN_FORKNUM);
+	}
 
 	logical_end_heap_rewrite(state);