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

Commit b607f08

Browse files
committed
let receiver work in synchronous_twophase mode
1 parent 66a6cac commit b607f08

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

multimaster.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,7 +1775,7 @@ static void MtmLoadPreparedTransactions(void)
17751775
MtmActivateTransaction(ts);
17761776
ts->status = strcmp(pxacts[i].state_3pc, MULTIMASTER_PRECOMMITTED) == 0 ? TRANSACTION_STATUS_UNKNOWN : TRANSACTION_STATUS_IN_PROGRESS;
17771777
ts->isLocal = true;
1778-
ts->isPrepared = true;
1778+
ts->isPrepared = strcmp(pxacts[i].state_3pc, MULTIMASTER_PRECOMMITTED) == 0;
17791779
ts->isPinned = false;
17801780
ts->snapshot = INVALID_CSN;
17811781
ts->isTwoPhase = false;
@@ -2074,15 +2074,15 @@ MtmPollStatusOfPreparedTransactions(bool majorMode)
20742074
{
20752075
MtmTransState *ts = MtmGetActiveTransaction(cur);
20762076

2077-
// MTM_LOG1("X_MtmPollStatusOfPreparedTransactions %s, major=%d, status=%d, isPrepared=%d, valid=%d, completed=%d", ts->gid, majorMode, ts->status, ts->isPrepared, TransactionIdIsValid(ts->gtid.xid), ts->votingCompleted);
2077+
MTM_LOG1("X_MtmPollStatusOfPreparedTransactions %s, major=%d, status=%d, isPrepared=%d, valid=%d, completed=%d", ts->gid, majorMode, ts->status, ts->isPrepared, TransactionIdIsValid(ts->gtid.xid), ts->votingCompleted);
20782078

20792079
if (TransactionIdIsValid(ts->gtid.xid)
20802080
&& ts->votingCompleted /* If voting is not yet completed, then there is some backend coordinating this transaction */
20812081
&& (ts->status == TRANSACTION_STATUS_UNKNOWN || ts->status == TRANSACTION_STATUS_IN_PROGRESS))
20822082
{
20832083
Assert(ts->gid[0]);
20842084

2085-
// MTM_LOG1("MtmPollStatusOfPreparedTransactions %s, major=%d, status=%d, isPrepared=%d", ts->gid, majorMode, ts->status, ts->isPrepared);
2085+
MTM_LOG1("MtmPollStatusOfPreparedTransactions %s, major=%d, status=%d, isPrepared=%d", ts->gid, majorMode, ts->status, ts->isPrepared);
20862086

20872087
if (majorMode)
20882088
{

pglogical_receiver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ pglogical_receiver_main(Datum main_arg)
303303
// synchronous_twophase = false;
304304
// else
305305
// synchronous_twophase = true;
306-
synchronous_twophase = false;
306+
synchronous_twophase = true;
307307

308308
if (mode == REPLMODE_EXIT)
309309
{

tests2/docker-entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ if [ "$1" = 'postgres' ]; then
5151
listen_addresses='*'
5252
max_prepared_transactions = 100
5353
synchronous_commit = on
54-
fsync = on
54+
fsync = off
5555
wal_level = logical
5656
max_worker_processes = 30
5757
max_replication_slots = 10
5858
max_wal_senders = 10
5959
shared_preload_libraries = 'multimaster'
6060
default_transaction_isolation = 'repeatable read'
6161
log_line_prefix = '%m [%p]: '
62-
wal_writer_delay = 1ms
62+
wal_writer_delay = 500ms
6363
# log_statement = all
6464
6565
multimaster.max_nodes = 3

0 commit comments

Comments
 (0)