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

Commitfc0d1ec

Browse files
author
Amit Kapila
committed
Fix comments atop ReorderBufferAddInvalidations.
The comments atop seem to indicate that we always accumulate invalidationmessages in a top-level transaction which is neither required nor matcheswith the code.Author: Amit KapilaReviewd by: Masahiko SawadaBackpatch-through: 14, where it was introduced in commitc55040cDiscussion:https://postgr.es/m/CAA4eK1LxGgnUroPz8STb6OfjVU1yaHoSA+T63URwmGCLdMJ0LA@mail.gmail.com
1 parent9e03211 commitfc0d1ec

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

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

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3197,16 +3197,17 @@ ReorderBufferAddNewTupleCids(ReorderBuffer *rb, TransactionId xid,
31973197
}
31983198

31993199
/*
3200-
*Setup theinvalidation of the toplevel transaction.
3200+
*Accumulate theinvalidations for executing them later.
32013201
*
32023202
* This needs to be called for each XLOG_XACT_INVALIDATIONS message and
3203-
* accumulates all the invalidation messages in the toplevel transaction as
3204-
* well as in the form of change in reorder buffer. We require to record it in
3205-
* form of the change so that we can execute only the required invalidations
3206-
* instead of executing all the invalidations on each CommandId increment. We
3207-
* also need to accumulate these in the toplevel transaction because in some
3208-
* cases we skip processing the transaction (see ReorderBufferForget), we need
3209-
* to execute all the invalidations together.
3203+
* accumulates all the invalidation messages in the toplevel transaction, if
3204+
* available, otherwise in the current transaction, as well as in the form of
3205+
* change in reorder buffer. We require to record it in form of the change
3206+
* so that we can execute only the required invalidations instead of executing
3207+
* all the invalidations on each CommandId increment. We also need to
3208+
* accumulate these in the txn buffer because in some cases where we skip
3209+
* processing the transaction (see ReorderBufferForget), we need to execute
3210+
* all the invalidations together.
32103211
*/
32113212
void
32123213
ReorderBufferAddInvalidations(ReorderBuffer*rb,TransactionIdxid,
@@ -3222,8 +3223,9 @@ ReorderBufferAddInvalidations(ReorderBuffer *rb, TransactionId xid,
32223223
oldcontext=MemoryContextSwitchTo(rb->context);
32233224

32243225
/*
3225-
* Collect all the invalidations under the top transaction so that we can
3226-
* execute them all together. See comment atop this function
3226+
* Collect all the invalidations under the top transaction, if available,
3227+
* so that we can execute them all together. See comments atop this
3228+
* function.
32273229
*/
32283230
if (txn->toptxn)
32293231
txn=txn->toptxn;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp