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

Commitaa6d5cf

Browse files
knizhnikkelvich
authored andcommitted
Define constant for precommitted state
1 parent8ba9bd3 commitaa6d5cf

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

‎multimaster.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ MtmVotingCompleted(MtmTransState* ts)
975975
return true;
976976
}elseif (MtmUseDtm) {
977977
ts->votedMask=0;
978-
SetPrepareTransactionState(ts->gid,"precommitted");
978+
SetPrepareTransactionState(ts->gid,MULTIMASTER_PRECOMMITTED);
979979
//MtmSend2PCMessage(ts, MSG_PRECOMMIT);
980980
return false;
981981
}else {
@@ -1131,7 +1131,7 @@ MtmCommitPreparedTransaction(MtmCurrentTrans* x)
11311131
ts->votedMask=0;
11321132
ts->procno=MyProc->pgprocno;
11331133
MTM_TXTRACE(ts,"Coordinator sends MSG_PRECOMMIT");
1134-
SetPrepareTransactionState(ts->gid,"precommitted");
1134+
SetPrepareTransactionState(ts->gid,MULTIMASTER_PRECOMMITTED);
11351135
//MtmSend2PCMessage(ts, MSG_PRECOMMIT);
11361136

11371137
Mtm2PCVoting(x,ts);
@@ -1374,7 +1374,7 @@ static voidMtmLoadPreparedTransactions(void)
13741374
Mtm->nActiveTransactions+=1;
13751375
ts->isEnqueued= false;
13761376
ts->isActive= true;
1377-
ts->status=strcmp(pxacts[i].state_3pc,"precommitted")==0 ?TRANSACTION_STATUS_UNKNOWN :TRANSACTION_STATUS_IN_PROGRESS;
1377+
ts->status=strcmp(pxacts[i].state_3pc,MULTIMASTER_PRECOMMITTED)==0 ?TRANSACTION_STATUS_UNKNOWN :TRANSACTION_STATUS_IN_PROGRESS;
13781378
ts->isLocal= true;
13791379
ts->isPrepared= false;
13801380
ts->isPinned= false;

‎multimaster.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@
1010
#include"commands/vacuum.h"
1111
#include"libpq-fe.h"
1212

13+
#ifndefDEBUG_LEVEL
1314
#defineDEBUG_LEVEL 0
14-
#defineMTM_TRACE 1
15+
#endif
16+
17+
#ifndefMTM_TRACE
18+
#defineMTM_TRACE 0
19+
#endif
1520

1621
#ifDEBUG_LEVEL==0
1722
#defineMTM_LOG1(fmt, ...) elog(LOG, fmt, ## __VA_ARGS__)
@@ -35,7 +40,7 @@
3540
#defineMTM_LOG4(fmt, ...) fprintf(stderr, fmt "\n", ## __VA_ARGS__)
3641
#endif
3742

38-
#ifndefMTM_TRACE
43+
#ifMTM_TRACE
3944
#defineMTM_TXTRACE(tx,event)
4045
#else
4146
#defineMTM_TXTRACE(tx,event) \
@@ -58,6 +63,7 @@
5863
#defineMULTIMASTER_LOCK_BUF_INIT_SIZE 4096
5964
#defineMULTIMASTER_BROADCAST_SERVICE "mtm_broadcast"
6065
#defineMULTIMASTER_ADMIN "mtm_admin"
66+
#defineMULTIMASTER_PRECOMMITTED "precommitted"
6167

6268
#defineMULTIMASTER_DEFAULT_ARBITER_PORT 5433
6369

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp