From c580dceaa20e7288940df7d7cb442bffe988908d Mon Sep 17 00:00:00 2001
From: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Date: Fri, 2 Aug 2024 20:51:31 +0900
Subject: [PATCH v36 09/17] Enable commit records to handle fork removals

Currently, COMMIT/ABORT WAL records store relation locators that need
to be removed at commit. This patch adds support for handling these
removals on a per-fork basis. While the PREPARE record can store the
same information, it is not used.
---
 src/backend/access/rmgrdesc/xactdesc.c | 48 ++++++++++++++++++++++----
 src/backend/access/transam/twophase.c  | 42 ++++++++++++++++++----
 src/backend/access/transam/xact.c      | 30 ++++++++++++----
 src/backend/storage/buffer/bufmgr.c    |  2 +-
 src/backend/storage/smgr/md.c          | 11 ++++--
 src/include/access/xact.h              |  8 +++++
 src/include/storage/md.h               |  3 +-
 7 files changed, 120 insertions(+), 24 deletions(-)

diff --git a/src/backend/access/rmgrdesc/xactdesc.c b/src/backend/access/rmgrdesc/xactdesc.c
index 889cb955c18..a086809dc75 100644
--- a/src/backend/access/rmgrdesc/xactdesc.c
+++ b/src/backend/access/rmgrdesc/xactdesc.c
@@ -82,6 +82,12 @@ ParseCommitRecord(uint8 info, xl_xact_commit *xlrec, xl_xact_parsed_commit *pars
 
 		data += MinSizeOfXactRelfileLocators;
 		data += xl_rellocators->nrels * sizeof(RelFileLocator);
+
+		if (parsed->xinfo & XACT_XINFO_HAS_RELFILEFORKS)
+		{
+			parsed->xforks = (ForkBitmap *)data;
+			data += xl_rellocators->nrels * sizeof(ForkBitmap);
+		}
 	}
 
 	if (parsed->xinfo & XACT_XINFO_HAS_DROPPED_STATS)
@@ -188,6 +194,12 @@ ParseAbortRecord(uint8 info, xl_xact_abort *xlrec, xl_xact_parsed_abort *parsed)
 
 		data += MinSizeOfXactRelfileLocators;
 		data += xl_rellocator->nrels * sizeof(RelFileLocator);
+
+		if (parsed->xinfo & XACT_XINFO_HAS_RELFILEFORKS)
+		{
+			parsed->xforks = (ForkBitmap *)data;
+			data += xl_rellocator->nrels * sizeof(ForkBitmap);
+		}
 	}
 
 	if (parsed->xinfo & XACT_XINFO_HAS_DROPPED_STATS)
@@ -262,9 +274,19 @@ ParsePrepareRecord(uint8 info, xl_xact_prepare *xlrec, xl_xact_parsed_prepare *p
 
 	parsed->xlocators = (RelFileLocator *) bufptr;
 	bufptr += MAXALIGN(xlrec->ncommitrels * sizeof(RelFileLocator));
+	if (xlrec->comhasforks)
+	{
+		parsed->xforks = (ForkBitmap *) bufptr;
+		bufptr += MAXALIGN(xlrec->ncommitrels * sizeof(ForkBitmap));
+	}
 
 	parsed->abortlocators = (RelFileLocator *) bufptr;
 	bufptr += MAXALIGN(xlrec->nabortrels * sizeof(RelFileLocator));
+	if (xlrec->abohasforks)
+	{
+		parsed->abortforks = (ForkBitmap *) bufptr;
+		bufptr += MAXALIGN(xlrec->nabortrels * sizeof(ForkBitmap));
+	}
 
 	parsed->stats = (xl_xact_stats_item *) bufptr;
 	bufptr += MAXALIGN(xlrec->ncommitstats * sizeof(xl_xact_stats_item));
@@ -278,7 +300,7 @@ ParsePrepareRecord(uint8 info, xl_xact_prepare *xlrec, xl_xact_parsed_prepare *p
 
 static void
 xact_desc_relations(StringInfo buf, char *label, int nrels,
-					RelFileLocator *xlocators)
+					RelFileLocator *xlocators, ForkBitmap *xforks)
 {
 	int			i;
 
@@ -291,6 +313,19 @@ xact_desc_relations(StringInfo buf, char *label, int nrels,
 
 			appendStringInfo(buf, " %s", path);
 			pfree(path);
+
+			if (xforks)
+			{
+				char delim = ':';
+				for (int j = 0 ; j <= MAX_FORKNUM ; j++)
+				{
+					if (FORKBITMAP_ISSET(xforks[i], j))
+					{
+						appendStringInfo(buf, "%c%d", delim, j);
+						delim = ',';
+					}
+				}
+			}
 		}
 	}
 }
@@ -343,7 +378,8 @@ xact_desc_commit(StringInfo buf, uint8 info, xl_xact_commit *xlrec, RepOriginId
 
 	appendStringInfoString(buf, timestamptz_to_str(xlrec->xact_time));
 
-	xact_desc_relations(buf, "rels", parsed.nrels, parsed.xlocators);
+	xact_desc_relations(buf, "rels",
+						parsed.nrels, parsed.xlocators, parsed.xforks);
 	xact_desc_subxacts(buf, parsed.nsubxacts, parsed.subxacts);
 	xact_desc_stats(buf, "", parsed.nstats, parsed.stats);
 
@@ -379,7 +415,8 @@ xact_desc_abort(StringInfo buf, uint8 info, xl_xact_abort *xlrec, RepOriginId or
 
 	appendStringInfoString(buf, timestamptz_to_str(xlrec->xact_time));
 
-	xact_desc_relations(buf, "rels", parsed.nrels, parsed.xlocators);
+	xact_desc_relations(buf, "rels",
+						parsed.nrels, parsed.xlocators, parsed.xforks);
 	xact_desc_subxacts(buf, parsed.nsubxacts, parsed.subxacts);
 
 	if (parsed.xinfo & XACT_XINFO_HAS_ORIGIN)
@@ -403,9 +440,8 @@ xact_desc_prepare(StringInfo buf, uint8 info, xl_xact_prepare *xlrec, RepOriginI
 	appendStringInfo(buf, "gid %s: ", parsed.twophase_gid);
 	appendStringInfoString(buf, timestamptz_to_str(parsed.xact_time));
 
-	xact_desc_relations(buf, "rels(commit)", parsed.nrels, parsed.xlocators);
-	xact_desc_relations(buf, "rels(abort)", parsed.nabortrels,
-						parsed.abortlocators);
+	xact_desc_relations(buf, "rels(commit)", parsed.nrels,
+						parsed.xlocators, parsed.xforks);
 	xact_desc_stats(buf, "commit ", parsed.nstats, parsed.stats);
 	xact_desc_stats(buf, "abort ", parsed.nabortstats, parsed.abortstats);
 	xact_desc_subxacts(buf, parsed.nsubxacts, parsed.subxacts);
diff --git a/src/backend/access/transam/twophase.c b/src/backend/access/transam/twophase.c
index 7e18be8025e..5c20065e408 100644
--- a/src/backend/access/transam/twophase.c
+++ b/src/backend/access/transam/twophase.c
@@ -203,6 +203,7 @@ static void RecordTransactionCommitPrepared(TransactionId xid,
 											TransactionId *children,
 											int nrels,
 											RelFileLocator *rels,
+											ForkBitmap *forks,
 											int nstats,
 											xl_xact_stats_item *stats,
 											int ninvalmsgs,
@@ -214,6 +215,7 @@ static void RecordTransactionAbortPrepared(TransactionId xid,
 										   TransactionId *children,
 										   int nrels,
 										   RelFileLocator *rels,
+										   ForkBitmap *forks,
 										   int nstats,
 										   xl_xact_stats_item *stats,
 										   const char *gid);
@@ -1089,7 +1091,9 @@ StartPrepare(GlobalTransaction gxact)
 	TwoPhaseFileHeader hdr;
 	TransactionId *children;
 	RelFileLocator *commitrels;
+	ForkBitmap	   *commitforks = NULL;
 	RelFileLocator *abortrels;
+	ForkBitmap	   *abortforks = NULL;
 	xl_xact_stats_item *abortstats = NULL;
 	xl_xact_stats_item *commitstats = NULL;
 	SharedInvalidationMessage *invalmsgs;
@@ -1116,7 +1120,9 @@ StartPrepare(GlobalTransaction gxact)
 	hdr.owner = gxact->owner;
 	hdr.nsubxacts = xactGetCommittedChildren(&children);
 	hdr.ncommitrels = smgrGetPendingDeletes(true, &commitrels);
+	hdr.comhasforks = false;
 	hdr.nabortrels = smgrGetPendingDeletes(false, &abortrels);
+	hdr.abohasforks = false;
 	hdr.ncommitstats =
 		pgstat_get_transactional_drops(true, &commitstats);
 	hdr.nabortstats =
@@ -1145,11 +1151,23 @@ StartPrepare(GlobalTransaction gxact)
 	{
 		save_state_data(commitrels, hdr.ncommitrels * sizeof(RelFileLocator));
 		pfree(commitrels);
+
+		if (hdr.comhasforks)
+		{
+			save_state_data(commitforks, hdr.ncommitrels * sizeof(ForkBitmap));
+			pfree(commitforks);
+		}
 	}
 	if (hdr.nabortrels > 0)
 	{
 		save_state_data(abortrels, hdr.nabortrels * sizeof(RelFileLocator));
 		pfree(abortrels);
+
+		if (hdr.abohasforks)
+		{
+			save_state_data(abortforks, hdr.nabortrels * sizeof(ForkBitmap));
+			pfree(abortforks);
+		}
 	}
 	if (hdr.ncommitstats > 0)
 	{
@@ -1532,8 +1550,11 @@ FinishPreparedTransaction(const char *gid, bool isCommit)
 	TransactionId latestXid;
 	TransactionId *children;
 	RelFileLocator *commitrels;
+	ForkBitmap	   *commitforks = NULL;
 	RelFileLocator *abortrels;
+	ForkBitmap	   *abortforks = NULL;
 	RelFileLocator *delrels;
+	ForkBitmap	   *delforks = NULL;
 	int			ndelrels;
 	xl_xact_stats_item *commitstats;
 	xl_xact_stats_item *abortstats;
@@ -1595,7 +1616,8 @@ FinishPreparedTransaction(const char *gid, bool isCommit)
 	if (isCommit)
 		RecordTransactionCommitPrepared(xid,
 										hdr->nsubxacts, children,
-										hdr->ncommitrels, commitrels,
+										hdr->ncommitrels,
+										commitrels, commitforks,
 										hdr->ncommitstats,
 										commitstats,
 										hdr->ninvalmsgs, invalmsgs,
@@ -1603,7 +1625,8 @@ FinishPreparedTransaction(const char *gid, bool isCommit)
 	else
 		RecordTransactionAbortPrepared(xid,
 									   hdr->nsubxacts, children,
-									   hdr->nabortrels, abortrels,
+									   hdr->nabortrels,
+									   abortrels, abortforks,
 									   hdr->nabortstats,
 									   abortstats,
 									   gid);
@@ -1624,6 +1647,9 @@ FinishPreparedTransaction(const char *gid, bool isCommit)
 	 */
 	gxact->valid = false;
 
+	/* Currently, prepare info should not have per-fork storage information. */
+	Assert(!commitforks);
+
 	/*
 	 * We have to remove any files that were supposed to be dropped. For
 	 * consistency with the regular xact.c code paths, must do this before
@@ -1635,15 +1661,17 @@ FinishPreparedTransaction(const char *gid, bool isCommit)
 	{
 		delrels = commitrels;
 		ndelrels = hdr->ncommitrels;
+		delforks = commitforks;
 	}
 	else
 	{
 		delrels = abortrels;
 		ndelrels = hdr->nabortrels;
+		delforks = abortforks;
 	}
 
 	/* Make sure files supposed to be dropped are dropped */
-	DropRelationFiles(delrels, ndelrels, false);
+	DropRelationFiles(delrels, delforks, ndelrels, false);
 
 	if (isCommit)
 		pgstat_execute_transactional_drops(hdr->ncommitstats, commitstats, false);
@@ -2337,7 +2365,7 @@ RecordTransactionCommitPrepared(TransactionId xid,
 								int nchildren,
 								TransactionId *children,
 								int nrels,
-								RelFileLocator *rels,
+								RelFileLocator *rels, ForkBitmap *forks,
 								int nstats,
 								xl_xact_stats_item *stats,
 								int ninvalmsgs,
@@ -2368,7 +2396,7 @@ RecordTransactionCommitPrepared(TransactionId xid,
 	 * not they do.
 	 */
 	recptr = XactLogCommitRecord(committs,
-								 nchildren, children, nrels, rels,
+								 nchildren, children, nrels, rels, forks,
 								 nstats, stats,
 								 ninvalmsgs, invalmsgs,
 								 initfileinval,
@@ -2436,6 +2464,7 @@ RecordTransactionAbortPrepared(TransactionId xid,
 							   TransactionId *children,
 							   int nrels,
 							   RelFileLocator *rels,
+							   ForkBitmap *forks,
 							   int nstats,
 							   xl_xact_stats_item *stats,
 							   const char *gid)
@@ -2466,8 +2495,7 @@ RecordTransactionAbortPrepared(TransactionId xid,
 	 * not they do.
 	 */
 	recptr = XactLogAbortRecord(GetCurrentTimestamp(),
-								nchildren, children,
-								nrels, rels,
+								nchildren, children, nrels, rels, forks,
 								nstats, stats,
 								MyXactFlags | XACT_FLAGS_ACQUIREDACCESSEXCLUSIVELOCK,
 								xid, gid);
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c
index fa9b1185f88..caf82312708 100644
--- a/src/backend/access/transam/xact.c
+++ b/src/backend/access/transam/xact.c
@@ -1319,6 +1319,7 @@ RecordTransactionCommit(void)
 	TransactionId latestXid = InvalidTransactionId;
 	int			nrels;
 	RelFileLocator *rels;
+	ForkBitmap	   *forks = NULL;
 	int			nchildren;
 	TransactionId *children;
 	int			ndroppedstats = 0;
@@ -1440,7 +1441,7 @@ RecordTransactionCommit(void)
 		 * Insert the commit XLOG record.
 		 */
 		XactLogCommitRecord(GetCurrentTransactionStopTimestamp(),
-							nchildren, children, nrels, rels,
+							nchildren, children, nrels, rels, forks,
 							ndroppedstats, droppedstats,
 							nmsgs, invalMessages,
 							RelcacheInitFileInval,
@@ -1757,6 +1758,7 @@ RecordTransactionAbort(bool isSubXact)
 	TransactionId latestXid;
 	int			nrels;
 	RelFileLocator *rels;
+	ForkBitmap	   *forks = NULL;
 	int			ndroppedstats = 0;
 	xl_xact_stats_item *droppedstats = NULL;
 	int			nchildren;
@@ -1818,7 +1820,7 @@ RecordTransactionAbort(bool isSubXact)
 
 	XactLogAbortRecord(xact_time,
 					   nchildren, children,
-					   nrels, rels,
+					   nrels, rels, forks,
 					   ndroppedstats, droppedstats,
 					   MyXactFlags, InvalidTransactionId,
 					   NULL);
@@ -5819,7 +5821,7 @@ xactGetCommittedChildren(TransactionId **ptr)
 XLogRecPtr
 XactLogCommitRecord(TimestampTz commit_time,
 					int nsubxacts, TransactionId *subxacts,
-					int nrels, RelFileLocator *rels,
+					int nrels, RelFileLocator *rels, ForkBitmap *forks,
 					int ndroppedstats, xl_xact_stats_item *droppedstats,
 					int nmsgs, SharedInvalidationMessage *msgs,
 					bool relcacheInval,
@@ -5887,6 +5889,9 @@ XactLogCommitRecord(TimestampTz commit_time,
 		xl_xinfo.xinfo |= XACT_XINFO_HAS_RELFILELOCATORS;
 		xl_relfilelocators.nrels = nrels;
 		info |= XLR_SPECIAL_REL_UPDATE;
+
+		if (forks)
+			xl_xinfo.xinfo |= XACT_XINFO_HAS_RELFILEFORKS;
 	}
 
 	if (ndroppedstats > 0)
@@ -5949,6 +5954,10 @@ XactLogCommitRecord(TimestampTz commit_time,
 						 MinSizeOfXactRelfileLocators);
 		XLogRegisterData((char *) rels,
 						 nrels * sizeof(RelFileLocator));
+
+		if (xl_xinfo.xinfo & XACT_XINFO_HAS_RELFILEFORKS)
+			XLogRegisterData((char *) forks,
+							 nrels * sizeof(ForkBitmap));
 	}
 
 	if (xl_xinfo.xinfo & XACT_XINFO_HAS_DROPPED_STATS)
@@ -5991,7 +6000,7 @@ XactLogCommitRecord(TimestampTz commit_time,
 XLogRecPtr
 XactLogAbortRecord(TimestampTz abort_time,
 				   int nsubxacts, TransactionId *subxacts,
-				   int nrels, RelFileLocator *rels,
+				   int nrels, RelFileLocator *rels, ForkBitmap *forks,
 				   int ndroppedstats, xl_xact_stats_item *droppedstats,
 				   int xactflags, TransactionId twophase_xid,
 				   const char *twophase_gid)
@@ -6036,6 +6045,9 @@ XactLogAbortRecord(TimestampTz abort_time,
 		xl_xinfo.xinfo |= XACT_XINFO_HAS_RELFILELOCATORS;
 		xl_relfilelocators.nrels = nrels;
 		info |= XLR_SPECIAL_REL_UPDATE;
+
+		if (forks)
+			xl_xinfo.xinfo |= XACT_XINFO_HAS_RELFILEFORKS;
 	}
 
 	if (ndroppedstats > 0)
@@ -6102,6 +6114,10 @@ XactLogAbortRecord(TimestampTz abort_time,
 						 MinSizeOfXactRelfileLocators);
 		XLogRegisterData((char *) rels,
 						 nrels * sizeof(RelFileLocator));
+
+		if (xl_xinfo.xinfo & XACT_XINFO_HAS_RELFILEFORKS)
+			XLogRegisterData((char *) forks,
+							 nrels * sizeof(ForkBitmap));
 	}
 
 	if (xl_xinfo.xinfo & XACT_XINFO_HAS_DROPPED_STATS)
@@ -6242,7 +6258,8 @@ xact_redo_commit(xl_xact_parsed_commit *parsed,
 		XLogFlush(lsn);
 
 		/* Make sure files supposed to be dropped are dropped */
-		DropRelationFiles(parsed->xlocators, parsed->nrels, true);
+		DropRelationFiles(parsed->xlocators, parsed->xforks, parsed->nrels,
+						  true);
 	}
 
 	AtEOXact_UndoLog(xid);
@@ -6356,7 +6373,8 @@ xact_redo_abort(xl_xact_parsed_abort *parsed, TransactionId xid,
 		 */
 		XLogFlush(lsn);
 
-		DropRelationFiles(parsed->xlocators, parsed->nrels, true);
+		DropRelationFiles(parsed->xlocators, parsed->xforks, parsed->nrels,
+						  true);
 	}
 
 	AtEOXact_UndoLog(xid);
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index df114e8e0c0..10d740cc688 100644
--- a/src/backend/storage/buffer/bufmgr.c
+++ b/src/backend/storage/buffer/bufmgr.c
@@ -160,7 +160,7 @@ static BufMgrCleanup * cleanups = NULL; /* head of linked list */
 typedef struct RelFileForks
 {
 	RelFileLocator rloc;	 /* key member for qsort */
-	ForkBitmap	   forks;	 /* fork number in bitmap */
+	ForkBitmap	   forks;	 /* fork numbers in bitmap */
 } RelFileForks;
 
 /* GUC variables */
diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c
index 92d77dffc92..55cc7aad73a 100644
--- a/src/backend/storage/smgr/md.c
+++ b/src/backend/storage/smgr/md.c
@@ -1458,7 +1458,8 @@ ForgetDatabaseSyncRequests(Oid dbid)
  * DropRelationFiles -- drop files of all given relations
  */
 void
-DropRelationFiles(RelFileLocator *delrels, int ndelrels, bool isRedo)
+DropRelationFiles(RelFileLocator *delrels, ForkBitmap *delforks, int ndelrels,
+				  bool isRedo)
 {
 	SMgrRelation *srels;
 	int			i;
@@ -1472,13 +1473,17 @@ DropRelationFiles(RelFileLocator *delrels, int ndelrels, bool isRedo)
 		{
 			ForkNumber	fork;
 
+			/* Close the spacified forks at smgr level. */
 			for (fork = 0; fork <= MAX_FORKNUM; fork++)
-				XLogDropRelation(delrels[i], fork);
+			{
+				if (!delforks || FORKBITMAP_ISSET(delforks[i], fork))
+					XLogDropRelation(delrels[i], fork);
+			}
 		}
 		srels[i] = srel;
 	}
 
-	smgrdounlinkall(srels, NULL, ndelrels, isRedo);
+	smgrdounlinkall(srels, delforks, ndelrels, isRedo);
 
 	for (i = 0; i < ndelrels; i++)
 		smgrclose(srels[i]);
diff --git a/src/include/access/xact.h b/src/include/access/xact.h
index fb64d7413a2..a5b61eec8f3 100644
--- a/src/include/access/xact.h
+++ b/src/include/access/xact.h
@@ -194,6 +194,7 @@ typedef struct SavedTransactionCharacteristics
 #define XACT_XINFO_HAS_AE_LOCKS			(1U << 6)
 #define XACT_XINFO_HAS_GID				(1U << 7)
 #define XACT_XINFO_HAS_DROPPED_STATS	(1U << 8)
+#define XACT_XINFO_HAS_RELFILEFORKS		(1U << 9)
 
 /*
  * Also stored in xinfo, these indicating a variety of additional actions that
@@ -359,7 +360,9 @@ typedef struct xl_xact_prepare
 	Oid			owner;			/* user running the transaction */
 	int32		nsubxacts;		/* number of following subxact XIDs */
 	int32		ncommitrels;	/* number of delete-on-commit rels */
+	bool		comhasforks;	/* commitrels is accompanied by forknums */
 	int32		nabortrels;		/* number of delete-on-abort rels */
+	bool		abohasforks;	/* commitrels is accompanied by forknums */
 	int32		ncommitstats;	/* number of stats to drop on commit */
 	int32		nabortstats;	/* number of stats to drop on abort */
 	int32		ninvalmsgs;		/* number of cache invalidation messages */
@@ -387,6 +390,7 @@ typedef struct xl_xact_parsed_commit
 
 	int			nrels;
 	RelFileLocator *xlocators;
+	ForkBitmap	   *xforks;
 
 	int			nstats;
 	xl_xact_stats_item *stats;
@@ -398,6 +402,7 @@ typedef struct xl_xact_parsed_commit
 	char		twophase_gid[GIDSIZE];	/* only for 2PC */
 	int			nabortrels;		/* only for 2PC */
 	RelFileLocator *abortlocators;	/* only for 2PC */
+	ForkBitmap	   *abortforks;
 	int			nabortstats;	/* only for 2PC */
 	xl_xact_stats_item *abortstats; /* only for 2PC */
 
@@ -420,6 +425,7 @@ typedef struct xl_xact_parsed_abort
 
 	int			nrels;
 	RelFileLocator *xlocators;
+	ForkBitmap	   *xforks;
 
 	int			nstats;
 	xl_xact_stats_item *stats;
@@ -503,6 +509,7 @@ extern int	xactGetCommittedChildren(TransactionId **ptr);
 extern XLogRecPtr XactLogCommitRecord(TimestampTz commit_time,
 									  int nsubxacts, TransactionId *subxacts,
 									  int nrels, RelFileLocator *rels,
+									  ForkBitmap *forks,
 									  int ndroppedstats,
 									  xl_xact_stats_item *droppedstats,
 									  int nmsgs, SharedInvalidationMessage *msgs,
@@ -514,6 +521,7 @@ extern XLogRecPtr XactLogCommitRecord(TimestampTz commit_time,
 extern XLogRecPtr XactLogAbortRecord(TimestampTz abort_time,
 									 int nsubxacts, TransactionId *subxacts,
 									 int nrels, RelFileLocator *rels,
+									 ForkBitmap *forks,
 									 int ndroppedstats,
 									 xl_xact_stats_item *droppedstats,
 									 int xactflags, TransactionId twophase_xid,
diff --git a/src/include/storage/md.h b/src/include/storage/md.h
index e7671dd6c18..46f2e44cf99 100644
--- a/src/include/storage/md.h
+++ b/src/include/storage/md.h
@@ -48,7 +48,8 @@ extern void mdimmedsync(SMgrRelation reln, ForkNumber forknum);
 extern void mdregistersync(SMgrRelation reln, ForkNumber forknum);
 
 extern void ForgetDatabaseSyncRequests(Oid dbid);
-extern void DropRelationFiles(RelFileLocator *delrels, int ndelrels, bool isRedo);
+extern void DropRelationFiles(RelFileLocator *delrels, ForkBitmap *delforks,
+							  int ndelrels, bool isRedo);
 
 /* md sync callbacks */
 extern int	mdsyncfiletag(const FileTag *ftag, char *path);
-- 
2.43.5

