Commit b6182081 authored by Tom Lane's avatar Tom Lane

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>
parent c7f68bea
...@@ -1158,17 +1158,15 @@ ReorderBufferCleanupTXN(ReorderBuffer *rb, ReorderBufferTXN *txn) ...@@ -1158,17 +1158,15 @@ ReorderBufferCleanupTXN(ReorderBuffer *rb, ReorderBufferTXN *txn)
txn->base_snapshot_lsn = InvalidXLogRecPtr; txn->base_snapshot_lsn = InvalidXLogRecPtr;
} }
/* delete from list of known subxacts */ /*
if (txn->is_known_as_subxact) * Remove TXN from its containing list.
{ *
/* NB: nsubxacts count of parent will be too high now */ * Note: if txn->is_known_as_subxact, we are deleting the TXN from its
dlist_delete(&txn->node); * parent's list of known subxacts; this leaves the parent's nsubxacts
} * count too high, but we don't care. Otherwise, we are deleting the TXN
/* delete from LSN ordered list of toplevel TXNs */ * from the LSN-ordered list of toplevel TXNs.
else */
{
dlist_delete(&txn->node); dlist_delete(&txn->node);
}
/* now remove reference from buffer */ /* now remove reference from buffer */
hash_search(rb->by_txn, hash_search(rb->by_txn,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment