File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -1121,6 +1121,9 @@ StandbyReleaseAllLocks(void)
11211121 * StandbyReleaseOldLocks
11221122 * Release standby locks held by top-level XIDs that aren't running,
11231123 * as long as they're not prepared transactions.
1124+ *
1125+ * This is needed to prune the locks of crashed transactions, which didn't
1126+ * write an ABORT/COMMIT record.
11241127 */
11251128void
11261129StandbyReleaseOldLocks (TransactionId oldxid )
@@ -1266,13 +1269,6 @@ standby_redo(XLogReaderState *record)
12661269 * transactions already committed, since those commits raced ahead when
12671270 * making WAL entries.
12681271 *
1269- * The loose timing also means that locks may be recorded that have a
1270- * zero xid, since xids are removed from procs before locks are removed.
1271- * So we must prune the lock list down to ensure we hold locks only for
1272- * currently running xids, performed by StandbyReleaseOldLocks().
1273- * Zero xids should no longer be possible, but we may be replaying WAL
1274- * from a time when they were possible.
1275- *
12761272 * For logical decoding only the running xacts information is needed;
12771273 * there's no need to look at the locking information, but it's logged anyway,
12781274 * as there's no independent knob to just enable logical decoding. For
You can’t perform that action at this time.
0 commit comments