aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2024-10-21 14:28:43 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2024-10-21 14:28:43 +0300
commit3c7d78427ea9d92d346ee9aada4fa483bd1059e8 (patch)
tree9305e23919e3e978fb072e66e4c91f46dff84e7f
parent1a43de5e0a591b66ef3d92f3fac5aefcc2dc02fe (diff)
downloadpostgresql-3c7d78427ea9d92d346ee9aada4fa483bd1059e8.tar.gz
postgresql-3c7d78427ea9d92d346ee9aada4fa483bd1059e8.zip
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
-rw-r--r--src/backend/storage/ipc/standby.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/backend/storage/ipc/standby.c b/src/backend/storage/ipc/standby.c
index 872679ca447..25267f0f85d 100644
--- a/src/backend/storage/ipc/standby.c
+++ b/src/backend/storage/ipc/standby.c
@@ -1121,6 +1121,9 @@ StandbyReleaseAllLocks(void)
* StandbyReleaseOldLocks
* Release standby locks held by top-level XIDs that aren't running,
* as long as they're not prepared transactions.
+ *
+ * This is needed to prune the locks of crashed transactions, which didn't
+ * write an ABORT/COMMIT record.
*/
void
StandbyReleaseOldLocks(TransactionId oldxid)
@@ -1266,13 +1269,6 @@ standby_redo(XLogReaderState *record)
* transactions already committed, since those commits raced ahead when
* making WAL entries.
*
- * The loose timing also means that locks may be recorded that have a
- * zero xid, since xids are removed from procs before locks are removed.
- * So we must prune the lock list down to ensure we hold locks only for
- * currently running xids, performed by StandbyReleaseOldLocks().
- * Zero xids should no longer be possible, but we may be replaying WAL
- * from a time when they were possible.
- *
* For logical decoding only the running xacts information is needed;
* there's no need to look at the locking information, but it's logged anyway,
* as there's no independent knob to just enable logical decoding. For