Skip to content

Commit f2a3d74

Browse files
committed
Update minimum recovery point on truncation during WAL replay of abort record.
If a file is truncated, we must update minRecoveryPoint. Once a file is truncated, there's no going back; it would not be safe to stop recovery at a point earlier than that anymore. Commit 7bffc9b changed xact_redo_commit() so that it updates minRecoveryPoint on truncation, but forgot to change xact_redo_abort(). Back-patch to all supported versions. Reported-by: mengjuan.cmj@alibaba-inc.com Author: Fujii Masao Reviewed-by: Heikki Linnakangas Discussion: https://postgr.es/m/b029fce3-4fac-4265-968e-16f36ff4d075.mengjuan.cmj@alibaba-inc.com
1 parent fc0d9b8 commit f2a3d74

File tree

1 file changed

+10
-1
lines changed
  • src/backend/access/transam

1 file changed

+10
-1
lines changed

src/backend/access/transam/xact.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5983,7 +5983,16 @@ xact_redo_abort(xl_xact_parsed_abort *parsed, TransactionId xid,
59835983
}
59845984

59855985
/* Make sure files supposed to be dropped are dropped */
5986-
DropRelationFiles(parsed->xnodes, parsed->nrels, true);
5986+
if (parsed->nrels > 0)
5987+
{
5988+
/*
5989+
* See comments about update of minimum recovery point on truncation,
5990+
* in xact_redo_commit().
5991+
*/
5992+
XLogFlush(lsn);
5993+
5994+
DropRelationFiles(parsed->xnodes, parsed->nrels, true);
5995+
}
59875996
}
59885997

59895998
void

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy