Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb618208

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 offwarnings from static code analyzers seems like a sufficient reason toput the complexity into a comment rather than the code.Aleksander AlekseevDiscussion: <20160404190345.54d84ee8@fujitsu>
1 parentc7f68be commitb618208

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

‎src/backend/replication/logical/reorderbuffer.c

Lines changed: 9 additions & 11 deletions
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)

[8]ページ先頭

©2009-2025 Movatter.jp