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

Commitb2225c9

Browse files
knizhnikkelvich
authored andcommitted
Cleanup disconnected bit for recovered node
1 parent0bec1d3 commitb2225c9

File tree

3 files changed

+42
-7
lines changed

3 files changed

+42
-7
lines changed

‎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
voidMtmRecoveryCompleted(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);

‎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
staticintreceiver_idle_time=0;
56-
staticboolreceiver_sync_mode=false;
56+
staticboolreceiver_sync_mode=true;
5757

5858
/* Worker name */
5959
charworker_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,

‎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+
staticraftable_get_traftable_get_impl;
7+
staticraftable_set_traftable_set_impl;
8+
9+
staticvoidRaftableResolve()
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(charconst*key,int*size,RaftableTimestamp*ts,boolnowait)
23+
{
24+
if (!MtmUseRaftable) {
25+
returnNULL;
26+
}
27+
RaftableResolve();
28+
return (*raftable_get_impl)(key,size,nowait ?0 :-1);
29+
}
30+
31+
32+
voidRaftableSet(charconst*key,voidconst*value,intsize,boolnowait)
33+
{
34+
if (MtmUseRaftable) {
35+
RaftableResolve();
36+
(*raftable_set_impl)(key,value,size,nowait ?0 :-1);
37+
}
38+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp