Skip to content

Commit d65f166

Browse files
committed
Fix premature PRECOMMITTED response by apply worker
1 parent 7bea7be commit d65f166

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

multimaster.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,8 +1203,6 @@ void MtmPrecommitTransaction(char const* gid)
12031203
ts->status = TRANSACTION_STATUS_UNKNOWN;
12041204
ts->csn = MtmAssignCSN();
12051205
MtmAdjustSubtransactions(ts);
1206-
if (Mtm->status != MTM_RECOVERY) // XXXX why?
1207-
MtmSend2PCMessage(ts, MSG_PRECOMMITTED);
12081206
MtmUnlock();
12091207
Assert(replorigin_session_origin != InvalidRepOriginId);
12101208
if (!IsTransactionState()) {
@@ -1215,6 +1213,11 @@ void MtmPrecommitTransaction(char const* gid)
12151213
} else {
12161214
SetPreparedTransactionState(ts->gid, MULTIMASTER_PRECOMMITTED);
12171215
}
1216+
/*
1217+
* We should send MSG_PRECOMMITTED only after SetPreparedTransactionState()
1218+
*/
1219+
if (Mtm->status != MTM_RECOVERY)
1220+
MtmSend2PCMessage(ts, MSG_PRECOMMITTED);
12181221
} else {
12191222
MTM_ELOG(WARNING, "MtmPrecommitTransaction: transaction '%s' is already in %s state", gid, MtmTxnStatusMnem[ts->status]);
12201223
MtmUnlock();

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy