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