Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b618208

Browse files
committed
Remove duplicate code from ReorderBufferCleanupTXN().
Andres is apparently the only hacker who thinks this code is better as-is. I (tgl) follow some of his logic, but the fact that it's setting off warnings from static code analyzers seems like a sufficient reason to put the complexity into a comment rather than the code. Aleksander Alekseev Discussion: <20160404190345.54d84ee8@fujitsu>
1 parent c7f68be commit b618208

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/backend/replication/logical/reorderbuffer.c

+9-11
Original file line numberDiff line numberDiff line change
@@ -1158,17 +1158,15 @@ ReorderBufferCleanupTXN(ReorderBuffer *rb, ReorderBufferTXN *txn)
11581158
txn->base_snapshot_lsn = InvalidXLogRecPtr;
11591159
}
11601160

1161-
/* delete from list of known subxacts */
1162-
if (txn->is_known_as_subxact)
1163-
{
1164-
/* NB: nsubxacts count of parent will be too high now */
1165-
dlist_delete(&txn->node);
1166-
}
1167-
/* delete from LSN ordered list of toplevel TXNs */
1168-
else
1169-
{
1170-
dlist_delete(&txn->node);
1171-
}
1161+
/*
1162+
* Remove TXN from its containing list.
1163+
*
1164+
* Note: if txn->is_known_as_subxact, we are deleting the TXN from its
1165+
* parent's list of known subxacts; this leaves the parent's nsubxacts
1166+
* count too high, but we don't care. Otherwise, we are deleting the TXN
1167+
* from the LSN-ordered list of toplevel TXNs.
1168+
*/
1169+
dlist_delete(&txn->node);
11721170

11731171
/* now remove reference from buffer */
11741172
hash_search(rb->by_txn,

0 commit comments

Comments
 (0)