Skip to content

Commit 4c57b00

Browse files
committed
Cleanup disconnected bit for recovered node
1 parent dd875d8 commit 4c57b00

File tree

5 files changed

+45
-8
lines changed

5 files changed

+45
-8
lines changed

contrib/mmts/multimaster.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -842,8 +842,9 @@ void MtmSendNotificationMessage(MtmTransState* ts, MtmMessageCode cmd)
842842

843843
void MtmRecoveryCompleted(void)
844844
{
845-
elog(WARNING, "Recevoery of node %d is completed", MtmNodeId);
845+
elog(WARNING, "Recovery of node %d is completed", MtmNodeId);
846846
Mtm->recoverySlot = 0;
847+
BIT_CLEAR(Mtm->disabledNodeMask, MtmNodeId-1);
847848
MtmSwitchClusterMode(MTM_ONLINE);
848849
}
849850

@@ -1745,10 +1746,6 @@ MtmReplicationStartupHook(struct PGLogicalStartupHookArgs* args)
17451746
break;
17461747
}
17471748
}
1748-
if (isRecoverySession) {
1749-
MTM_INFO("%d: PGLOGICAL startup hook\n", MyProcPid);
1750-
sleep(30);
1751-
}
17521749
MtmLock(LW_EXCLUSIVE);
17531750
if (isRecoverySession) {
17541751
elog(WARNING, "Node %d start recovery of node %d", MtmNodeId, MtmReplicationNodeId);

contrib/mmts/pglogical_receiver.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static volatile sig_atomic_t got_sighup = false;
5353

5454
/* GUC variables */
5555
static int receiver_idle_time = 0;
56-
static bool receiver_sync_mode = false;
56+
static bool receiver_sync_mode = true;
5757

5858
/* Worker name */
5959
char worker_proc[BGW_MAXLEN];
@@ -292,7 +292,7 @@ pglogical_receiver_main(Datum main_arg)
292292
}
293293
CommitTransactionCommand();
294294

295-
appendPQExpBuffer(query, "START_REPLICATION SLOT \"%s\" LOGICAL %u/%u (\"startup_params_format\" '1', \"max_proto_version\" '%d', \"min_proto_version\" '%d', \"mtm_replication_mode\" '%s')",
295+
appendPQExpBuffer(query, "START_REPLICATION SLOT \"%s\" LOGICAL %u/%u (\"startup_params_format\" '1', \"max_proto_version\" '%d', \"min_proto_version\" '%d', \"forward_changesets\" '1', \"mtm_replication_mode\" '%s')",
296296
args->receiver_slot,
297297
(uint32) (originStartPos >> 32),
298298
(uint32) originStartPos,

contrib/mmts/raftable.c

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#include <dlfcn.h>
2+
#include "postgres.h"
3+
#include "raftable.h"
4+
5+
6+
static raftable_get_t raftable_get_impl;
7+
static raftable_set_t raftable_set_impl;
8+
9+
static void RaftableResolve()
10+
{
11+
if (raftable_get_impl == NULL) {
12+
void* dll = dlopen(NULL, RTLD_NOW);
13+
raftable_get_impl = dlsym(dll, "raftable_get");
14+
raftable_set_impl = dlsym(dll, "raftable_set");
15+
Assert(raftable_get_impl != NULL && raftable_set_impl != NULL);
16+
}
17+
}
18+
19+
/*
20+
* Raftable function proxies
21+
*/
22+
void* RaftableGet(char const* key, int* size, RaftableTimestamp* ts, bool nowait)
23+
{
24+
if (!MtmUseRaftable) {
25+
return NULL;
26+
}
27+
RaftableResolve();
28+
return (*raftable_get_impl)(key, size, nowait ? 0 : -1);
29+
}
30+
31+
32+
void RaftableSet(char const* key, void const* value, int size, bool nowait)
33+
{
34+
if (MtmUseRaftable) {
35+
RaftableResolve();
36+
(*raftable_set_impl)(key, value, size, nowait ? 0 : -1);
37+
}
38+
}

src/backend/replication/walsender.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,8 @@ StartLogicalReplication(StartReplicationCmd *cmd)
992992
* Initialize position to the last ack'ed one, then the xlog records begin
993993
* to be shipped from that position.
994994
*/
995+
elog(WARNING, "%d: StartLogicalReplication for slot %s startpoint %lx", MyProcPid, NameStr(MyReplicationSlot->data.name), cmd->startpoint);
996+
995997
logical_decoding_ctx = CreateDecodingContext(
996998
cmd->startpoint, cmd->options,
997999
logical_read_xlog_page,

src/include/miscadmin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ do { \
114114

115115
#define RESUME_INTERRUPTS() \
116116
do { \
117-
Assert(InterruptHoldoffCount > 0); \
117+
if (InterruptHoldoffCount <= 0) *(int*)0 = 0; \
118118
InterruptHoldoffCount--; \
119119
} while(0)
120120

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