@@ -636,7 +636,8 @@ def init_pb(self, backup_dir, options=[], old_binary=False):
636636
637637shutil .rmtree (backup_dir ,ignore_errors = True )
638638
639- if self .remote :
639+ # don`t forget to kill old_binary after remote ssh release
640+ if self .remote and not old_binary :
640641options = options + [
641642'--remote-proto=ssh' ,
642643'--remote-host=localhost' ]
@@ -657,7 +658,8 @@ def add_instance(self, backup_dir, instance, node, old_binary=False, options=[])
657658'-D' ,node .data_dir
658659 ]
659660
660- if self .remote :
661+ # don`t forget to kill old_binary after remote ssh release
662+ if self .remote and not old_binary :
661663options = options + [
662664'--remote-proto=ssh' ,
663665'--remote-host=localhost' ]
@@ -710,7 +712,9 @@ def backup_node(
710712'-d' ,'postgres' ,
711713'--instance={0}' .format (instance )
712714 ]
713- if self .remote :
715+
716+ # don`t forget to kill old_binary after remote ssh release
717+ if self .remote and not old_binary :
714718options = options + [
715719'--remote-proto=ssh' ,
716720'--remote-host=localhost' ]
@@ -736,6 +740,7 @@ def restore_node(
736740self ,backup_dir ,instance ,node = False ,
737741data_dir = None ,backup_id = None ,old_binary = False ,options = []
738742 ):
743+
739744if data_dir is None :
740745data_dir = node .data_dir
741746
@@ -745,7 +750,9 @@ def restore_node(
745750'-D' ,data_dir ,
746751'--instance={0}' .format (instance )
747752 ]
748- if self .remote :
753+
754+ # don`t forget to kill old_binary after remote ssh release
755+ if self .remote and not old_binary :
749756options = options + [
750757'--remote-proto=ssh' ,
751758'--remote-host=localhost' ]
@@ -943,8 +950,9 @@ def set_archiving(
943950backup_dir .replace ("\\ " ,"\\ \\ " ),
944951instance )
945952
946- # if self.remote:
947- # archive_command = archive_command + '--remote-proto=ssh --remote-host=localhost '
953+ # don`t forget to kill old_binary after remote ssh release
954+ if self .remote and not old_binary :
955+ archive_command = archive_command + '--remote-proto=ssh --remote-host=localhost '
948956
949957if self .archive_compress or compress :
950958archive_command = archive_command + '--compress '
@@ -1062,6 +1070,8 @@ def switch_wal_segment(self, node):
10621070else :
10631071node .execute ('select pg_switch_xlog()' )
10641072
1073+ sleep (1 )
1074+
10651075def wait_until_replica_catch_with_master (self ,master ,replica ):
10661076
10671077if self .version_to_num (