@@ -1932,7 +1932,7 @@ static void MtmCheckControlFile(void)
1932
1932
if (f == NULL ) {
1933
1933
elog (FATAL ,"Failed to create mmts_control file: %m" );
1934
1934
}
1935
- Mtm -> donorNodeId = -1 ;
1935
+ Mtm -> donorNodeId = MtmNodeId ;
1936
1936
fprintf (f ,"%s:%d\n" ,MtmClusterName ,Mtm -> donorNodeId );
1937
1937
fclose (f );
1938
1938
}
@@ -2706,7 +2706,7 @@ MtmReplicationMode MtmGetReplicationMode(int nodeId, sig_atomic_t volatile* shut
2706
2706
MtmLock (LW_EXCLUSIVE );
2707
2707
if (Mtm -> status == MTM_RECOVERY ) {
2708
2708
recovery = true;
2709
- if ((Mtm -> recoverySlot == 0 && (Mtm -> donorNodeId < 0 || Mtm -> donorNodeId == nodeId ))
2709
+ if ((Mtm -> recoverySlot == 0 && (Mtm -> donorNodeId == MtmNodeId || Mtm -> donorNodeId == nodeId ))
2710
2710
|| Mtm -> recoverySlot == nodeId )
2711
2711
{
2712
2712
/* Choose for recovery first available slot or slot of donor node (if any) */
@@ -2819,7 +2819,7 @@ MtmReplicationStartupHook(struct PGLogicalStartupHookArgs* args)
2819
2819
}
2820
2820
}else if (strcmp ("mtm_restart_pos" ,elem -> defname )== 0 ) {
2821
2821
if (elem -> arg != NULL && strVal (elem -> arg )!= NULL ) {
2822
- recoveryStartPos = intVal ( elem -> arg );
2822
+ sscanf ( strVal ( elem -> arg ), "%lx" , & recoveryStartPos );
2823
2823
}else {
2824
2824
elog (ERROR ,"Restart position is not specified" );
2825
2825
}