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