Properly delete relation files on commit record replay.
Resolving the GPDB_84_MERGE_FIXME now, that we match close to upstream. Without
thsi fix the relation files were not dropped during recovery or replay on
mirrors.
@@ -5547,9 +5547,8 @@ xact_redo_commit(xl_xact_commit *xlrec, TransactionId xid,
TransactionIdAdvance(ShmemVariableCache->nextXid);
}
- /* GPDB_84_MERGE_FIXME: This came from upstream, but the old code this replaced
- * had been removed from this function GPDB. Where does this belong now? */
-#if 0
+ for (i = 0; i < xlrec->nrels; i++)
+ {
SMgrRelation srel = smgropen(xlrec->xnodes[i]);
ForkNumber fork;
@@ -5563,7 +5562,6 @@ xact_redo_commit(xl_xact_commit *xlrec, TransactionId xid,
}
smgrclose(srel);
}
-#endif
}
static void
@@ -5645,9 +5643,8 @@ xact_redo_distributed_commit(xl_xact_commit *xlrec, TransactionId xid)
TransactionIdAdvance(ShmemVariableCache->nextXid);
}
- /* GPDB_84_MERGE_FIXME: This came from upstream, but the old code this replaced
- * had been removed from this function GPDB. Where does this belong now? */
-#if 0
+ for (i = 0; i < xlrec->nrels; i++)
+ {
SMgrRelation srel = smgropen(xlrec->xnodes[i]);
ForkNumber fork;
@@ -5660,7 +5657,7 @@ xact_redo_distributed_commit(xl_xact_commit *xlrec, TransactionId xid)
}
}
smgrclose(srel);
-#endif
+ }
}
/*
@@ -5694,9 +5691,6 @@ xact_redo_abort(xl_xact_abort *xlrec, TransactionId xid)
TransactionIdAdvance(ShmemVariableCache->nextXid);
}
- /* GPDB_84_MERGE_FIXME: This came from upstream, but the old code this replaced
- * had been removed from this function GPDB. Where does this belong now? */
-#if 0
/* Make sure files supposed to be dropped are dropped */
for (i = 0; i < xlrec->nrels; i++)
{
@@ -5713,7 +5707,6 @@ xact_redo_abort(xl_xact_abort *xlrec, TransactionId xid)
}
smgrclose(srel);
}
-#endif
}
static void
