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

Commit52d26d5

Browse files
author
Amit Kapila
committed
Allow streaming the changes after speculative aborts.
Until now, we didn't allow to stream the changes in logical replicationtill we receive speculative confirm or the next DML change record afterspeculative inserts. The reason was that we never use to processspeculative aborts but after commit4daa140 it is possible to processthem so we can allow streaming once we receive speculative abort afterspeculative insertion.We decided to backpatch to 14 where the feature for streaming in progresstransactions have been introduced as this is a minor change and makes thatfunctionality better.Author: Amit KapilaReviewed-By: Dilip KumarBackpatch-through: 14Discussion:https://postgr.es/m/CAA4eK1KdqmTCtrBR6oFfGELrLLbDLDedL6zACcsUOQuTJBj1vw@mail.gmail.com
1 parentcda03cf commit52d26d5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,10 @@ typedef struct ReorderBufferDiskChange
182182
( \
183183
((action) == REORDER_BUFFER_CHANGE_INTERNAL_SPEC_INSERT) \
184184
)
185-
#defineIsSpecConfirm(action) \
185+
#defineIsSpecConfirmOrAbort(action) \
186186
( \
187-
((action) == REORDER_BUFFER_CHANGE_INTERNAL_SPEC_CONFIRM) \
187+
(((action) == REORDER_BUFFER_CHANGE_INTERNAL_SPEC_CONFIRM) || \
188+
((action) == REORDER_BUFFER_CHANGE_INTERNAL_SPEC_ABORT)) \
188189
)
189190
#defineIsInsertOrUpdate(action) \
190191
( \
@@ -731,12 +732,13 @@ ReorderBufferProcessPartialChange(ReorderBuffer *rb, ReorderBufferTXN *txn,
731732

732733
/*
733734
* Indicate a partial change for speculative inserts. The change will be
734-
* considered as complete once we get the speculative confirm token.
735+
* considered as complete once we get the speculative confirm or abort
736+
* token.
735737
*/
736738
if (IsSpecInsert(change->action))
737739
toptxn->txn_flags |=RBTXN_HAS_PARTIAL_CHANGE;
738740
elseif (rbtxn_has_partial_change(toptxn)&&
739-
IsSpecConfirm(change->action))
741+
IsSpecConfirmOrAbort(change->action))
740742
toptxn->txn_flags &= ~RBTXN_HAS_PARTIAL_CHANGE;
741743

742744
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp