diff --git a/src/backend/access/transam/twophase.c b/src/backend/access/transam/twophase.c index cf0a6c40625..d26668db8b6 100644 --- a/src/backend/access/transam/twophase.c +++ b/src/backend/access/transam/twophase.c @@ -2018,6 +2018,12 @@ RecoverPreparedTransactions(void) if (InHotStandby) StandbyReleaseLockTree(xid, hdr->nsubxacts, subxids); + /* + * We're done with recovering this transaction. Clear MyLockedGxact, + * like we do in PrepareTransaction() during normal operation. + */ + PostPrepare_Twophase(); + pfree(buf); } }