summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/transam/xact.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c
index e75062e0f96..2ccb582100e 100644
--- a/src/backend/access/transam/xact.c
+++ b/src/backend/access/transam/xact.c
@@ -5545,7 +5545,8 @@ xact_redo_commit(xl_xact_parsed_commit *parsed,
* because subtransaction commit is never WAL logged.
*/
static void
-xact_redo_abort(xl_xact_parsed_abort *parsed, TransactionId xid)
+xact_redo_abort(xl_xact_parsed_abort *parsed, TransactionId xid,
+ XLogRecPtr lsn)
{
TransactionId max_xid;
@@ -5607,7 +5608,16 @@ xact_redo_abort(xl_xact_parsed_abort *parsed, TransactionId xid)
}
/* Make sure files supposed to be dropped are dropped */
- DropRelationFiles(parsed->xnodes, parsed->nrels, true);
+ if (parsed->nrels > 0)
+ {
+ /*
+ * See comments about update of minimum recovery point on truncation,
+ * in xact_redo_commit().
+ */
+ XLogFlush(lsn);
+
+ DropRelationFiles(parsed->xnodes, parsed->nrels, true);
+ }
}
void
@@ -5651,12 +5661,12 @@ xact_redo(XLogReaderState *record)
if (info == XLOG_XACT_ABORT)
{
Assert(!TransactionIdIsValid(parsed.twophase_xid));
- xact_redo_abort(&parsed, XLogRecGetXid(record));
+ xact_redo_abort(&parsed, XLogRecGetXid(record), record->EndRecPtr);
}
else
{
Assert(TransactionIdIsValid(parsed.twophase_xid));
- xact_redo_abort(&parsed, parsed.twophase_xid);
+ xact_redo_abort(&parsed, parsed.twophase_xid, record->EndRecPtr);
RemoveTwoPhaseFile(parsed.twophase_xid, false);
}
}