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

Commit 2ac4057

Browse files
committed
Revert "PGPRO-1238 fix recovery of prepared tranasctions in minor node"
This reverts commit 98e6b043f2a8c93ffe6df2777dfa94837eb155a3.
1 parent cdec612 commit 2ac4057

File tree

4 files changed

+9
-33
lines changed

4 files changed

+9
-33
lines changed

multimaster.c

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1707,27 +1707,8 @@ static void MtmBroadcastPollMessage(MtmTransState* ts)
17071707

17081708
if (nparts == 1)
17091709
{
1710-
int refereeWinnerId = MtmRefereeReadSaved();
1711-
if (MtmMajorNode || refereeWinnerId == MtmNodeId)
1712-
{
1713-
MTM_ELOG(LOG, "%s node commits prepared transaction %s", MtmMajorNode ? "Major" : "Winner", ts->gid);
1714-
/* we were in major mode and there nobody to ask about status */
1715-
MtmFinishPreparedTransaction(ts, true);
1716-
}
1717-
else
1718-
{
1719-
int coordinator = 0;
1720-
sscanf(ts->gid, "MTM-%d", &coordinator);
1721-
if (coordinator == MtmNodeId && ts->status == TRANSACTION_STATUS_IN_PROGRESS) {
1722-
/* it is always safe to rollback self transaction which was not precommitted: it can not be committed anywhere else */
1723-
MTM_ELOG(LOG, "Coordinator node rollback not precommitted transaction %s", ts->gid);
1724-
MtmFinishPreparedTransaction(ts, false);
1725-
}
1726-
else
1727-
{
1728-
MTM_ELOG(WARNING, "Doesn't know waht to do with transaction prepared transaction %s", ts->gid);
1729-
}
1730-
}
1710+
/* we were in major mode and there nobody to ask about status */
1711+
MtmFinishPreparedTransaction(ts, true);
17311712
return;
17321713
}
17331714

state.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ char const* const MtmEventMnem[] =
3131

3232
static int MtmRefereeGetWinner(void);
3333
static bool MtmRefereeClearWinner(void);
34+
static int MtmRefereeReadSaved(void);
3435

3536
static bool mtm_state_initialized;
3637

@@ -585,7 +586,7 @@ MtmRefereeHasLocalTable()
585586
return OidIsValid(rel_oid);
586587
}
587588

588-
int
589+
static int
589590
MtmRefereeReadSaved(void)
590591
{
591592
int winner = -1;

state.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,9 @@ extern void MtmOnNodeDisconnect(int nodeId);
3030
extern void MtmOnNodeConnect(int nodeId);
3131
extern void MtmReconnectNode(int nodeId);
3232

33-
extern int MtmRefereeReadSaved(void);
34-
3533
extern void MtmRefreshClusterStatus(void);
3634

3735
extern int countZeroBits(nodemask_t mask, int nNodes);
3836

3937
extern MtmNodeStatus MtmGetCurrentStatus(void);
40-
extern nodemask_t MtmGetDisabledNodeMask(void);
38+
extern nodemask_t MtmGetDisabledNodeMask(void);

tests/makefile

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
CXX=g++
2-
CC=gcc
3-
CFLAGS=-g -Wall -O0 -pthread
2+
CXXFLAGS=-g -Wall -O0 -pthread
43

5-
all: dtmbench dtmacid insert
4+
all: dtmbench dtmacid
65

76
dtmbench: dtmbench.cpp
8-
$(CXX) $(CFLAGS) -o dtmbench dtmbench.cpp -lpqxx -lpq
7+
$(CXX) $(CXXFLAGS) -o dtmbench dtmbench.cpp -lpqxx -lpq
98

109
dtmacid: dtmacid.cpp
11-
$(CXX) $(CFLAGS) -o dtmacid dtmacid.cpp -lpqxx -lpq
12-
13-
insert: insert.c
14-
$(CC) $(CFLAGS) -o insert insert.c -lpq
10+
$(CXX) $(CXXFLAGS) -o dtmacid dtmacid.cpp -lpqxx -lpq
1511

1612
clean:
1713
rm -f dtmbench dtmacid

0 commit comments

Comments
 (0)