Skip to content

Commit 3c7d784

Browse files
committed
Update outdated comment on WAL-logged locks with invalid XID
We haven't generated those for a long time. Discussion: https://www.postgresql.org/message-id/b439edfc-c5e5-43a9-802d-4cb51ec20646@iki.fi
1 parent 1a43de5 commit 3c7d784

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/backend/storage/ipc/standby.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff 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
*/
11251128
void
11261129
StandbyReleaseOldLocks(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

0 commit comments

Comments
 (0)