From 15e63afe7dde679a1b8c604fee3fec11004079a4 Mon Sep 17 00:00:00 2001 From: Konstantin Knizhnik Date: Mon, 17 Mar 2025 08:07:24 +0200 Subject: [PATCH] Support DEBUG_COMPARE_LOCAL mode for unloggedindex build (#11257) ## Problem In unlogged index build (used fir GIST/SPGIST/GIN indexes) files is created on disk and then removed at the end. It contradicts to the logic of DEBUG_COMPARE_LOCAL mode. ## Summary of changes Do not create and unlink files in unlogged build in DEBUG_COMPARE_LOCAL mode. Co-authored-by: Konstantin Knizhnik --- pgxn/neon/pagestore_smgr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pgxn/neon/pagestore_smgr.c b/pgxn/neon/pagestore_smgr.c index 6fe95df3dd..ae92be4577 100644 --- a/pgxn/neon/pagestore_smgr.c +++ b/pgxn/neon/pagestore_smgr.c @@ -4176,8 +4176,10 @@ neon_start_unlogged_build(SMgrRelation reln) * FIXME: should we pass isRedo true to create the tablespace dir if it * doesn't exist? Is it needed? */ - if (!IsParallelWorker()) +#ifndef DEBUG_COMPARE_LOCAL + if (!IsParallelWorker()) mdcreate(reln, MAIN_FORKNUM, false); +#endif } /* @@ -4252,8 +4254,10 @@ neon_end_unlogged_build(SMgrRelation reln) forget_cached_relsize(InfoFromNInfoB(rinfob), forknum); mdclose(reln, forknum); +#ifndef DEBUG_COMPARE_LOCAL /* use isRedo == true, so that we drop it immediately */ mdunlink(rinfob, forknum, true); +#endif } }