--- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -7574,6 +7574,19 @@ StartupXLOG(void) LWLockRelease(XidGenLock); } + /* + * Assign subtransaction xids to the top level xid if the + * record has that information. This is required at most + * once per subtransactions. + */ + if (TransactionIdIsValid(xlogreader->toplevel_xid) && + standbyState >= STANDBY_INITIALIZED) + { + Assert(XLogStandbyInfoActive()); + ProcArrayApplyXidAssignment(xlogreader->toplevel_xid, + 1, &record->xl_xid); + } + /* * Before replaying this record, check if this record causes * the current timeline to change. The record is already