diff --git a/src/backend/access/transam/twophase.c b/src/backend/access/transam/twophase.c index c29f86bec3a..a5c9ee8e865 100644 --- a/src/backend/access/transam/twophase.c +++ b/src/backend/access/transam/twophase.c @@ -1998,6 +1998,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); } }