Content-Length: 314529 | pFad | http://github.com/m99coder/postgres_cluster/commit/c3b857a3624121a111e9c3c14c3a4b6c3fa153fa

4F commit recovered prepared tx that were produced by a sible major · m99coder/postgres_cluster@c3b857a · GitHub
Skip to content

Commit c3b857a

Browse files
committed
commit recovered prepared tx that were produced by a sible major
1 parent 6247ad7 commit c3b857a

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

multimaster.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1687,7 +1687,19 @@ void MtmSend2PCMessage(MtmTransState* ts, MtmMessageCode cmd)
16871687
static void MtmBroadcastPollMessage(MtmTransState* ts)
16881688
{
16891689
int i;
1690+
int nparts;
16901691
MtmArbiterMessage msg;
1692+
1693+
nparts = Mtm->nAllNodes - countZeroBits(ts->participantsMask, Mtm->nAllNodes);
1694+
MTM_LOG1("MtmBroadcastPollMessage: %s %lld %d", ts->gid, ts->participantsMask, nparts);
1695+
1696+
if (nparts == 1)
1697+
{
1698+
/* we were in major mode and there nobody to ask about status */
1699+
MtmFinishPreparedTransaction(ts, true);
1700+
return;
1701+
}
1702+
16911703
MtmInitMessage(&msg, MSG_POLL_REQUEST);
16921704
memcpy(msg.gid, ts->gid, MULTIMASTER_MAX_GID_SIZE);
16931705
ts->votedMask = 0;

state.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ maskToString(nodemask_t mask, int nNodes)
4141
return strMask;
4242
}
4343

44-
static int
44+
int
4545
countZeroBits(nodemask_t mask, int nNodes)
4646
{
4747
int i, count = 0;

state.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@ extern void MtmOnNodeConnect(int nodeId);
3131
extern void MtmReconnectNode(int nodeId);
3232

3333
extern void MtmRefreshClusterStatus(void);
34+
35+
extern int countZeroBits(nodemask_t mask, int nNodes);

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/m99coder/postgres_cluster/commit/c3b857a3624121a111e9c3c14c3a4b6c3fa153fa

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy