Fix variable reference in comment
authorHeikki Linnakangas <[email protected]>
Fri, 20 Dec 2024 17:36:33 +0000 (19:36 +0200)
committerHeikki Linnakangas <[email protected]>
Fri, 20 Dec 2024 17:36:33 +0000 (19:36 +0200)
This used to say "nsubxcnt isn't decreased when subtransactions
abort", but there's no variable called nsubxcnt. Commit 8548ddc61b
changed it to "subxcnt", among other typo fixes, but that was wrong
too: the comment actually talks about txn->nsubtxns. That's the field
that's incremented but never decremented and is used for the
allocation earlier in the function.

src/backend/replication/logical/reorderbuffer.c

index e3a5c7b660c5b852d6c58b18d11d8151a23b59aa..9313d2b01e140a7a1b15599225792a4bbb4b84f1 100644 (file)
@@ -1861,9 +1861,9 @@ ReorderBufferCopySnap(ReorderBuffer *rb, Snapshot orig_snap,
    snap->subxip[i++] = txn->xid;
 
    /*
-    * subxcnt isn't decreased when subtransactions abort, so count manually.
-    * Since it's an upper boundary it is safe to use it for the allocation
-    * above.
+    * txn->nsubtxns isn't decreased when subtransactions abort, so count
+    * manually. Since it's an upper boundary it is safe to use it for the
+    * allocation above.
     */
    snap->subxcnt = 1;