@@ -2015,32 +2015,16 @@ def test_archive_pg_receivexlog_partial_handling(self):
2015
2015
2016
2016
node .slow_start ()
2017
2017
2018
- self .backup_node (backup_dir ,'node' ,node ,options = ['--stream' ])
2019
-
2020
- replica = self .make_simple_node (
2021
- base_dir = os .path .join (module_name ,fname ,'replica' ))
2022
- replica .cleanup ()
2023
-
2024
- self .restore_node (
2025
- backup_dir ,'node' ,replica ,replica .data_dir ,options = ['-R' ])
2026
- self .set_auto_conf (replica , {'port' :replica .port })
2027
- self .set_replica (node ,replica )
2028
-
2029
- self .add_instance (backup_dir ,'replica' ,replica )
2030
- # self.set_archiving(backup_dir, 'replica', replica, replica=True)
2031
-
2032
- replica .slow_start (replica = True )
2033
-
2034
- if self .get_version (replica )< 100000 :
2018
+ if self .get_version (node )< 100000 :
2035
2019
app_name = 'pg_receivexlog'
2036
2020
pg_receivexlog_path = self .get_bin_path ('pg_receivexlog' )
2037
2021
else :
2038
2022
app_name = 'pg_receivewal'
2039
2023
pg_receivexlog_path = self .get_bin_path ('pg_receivewal' )
2040
2024
2041
2025
cmdline = [
2042
- pg_receivexlog_path ,'-p' ,str (replica .port ),'--synchronous' ,
2043
- '-D' ,os .path .join (backup_dir ,'wal' ,'replica ' )]
2026
+ pg_receivexlog_path ,'-p' ,str (node .port ),'--synchronous' ,
2027
+ '-D' ,os .path .join (backup_dir ,'wal' ,'node ' )]
2044
2028
2045
2029
if self .archive_compress and node .major_version >= 10 :
2046
2030
cmdline += ['-Z' ,'1' ]
@@ -2053,8 +2037,12 @@ def test_archive_pg_receivexlog_partial_handling(self):
2053
2037
'Failed to start pg_receivexlog: {0}' .format (
2054
2038
pg_receivexlog .communicate ()[1 ]))
2055
2039
2040
+ self .set_auto_conf (node , {'synchronous_standby_names' :app_name })
2041
+ self .set_auto_conf (node , {'synchronous_commit' :'on' })
2042
+ node .reload ()
2043
+
2056
2044
# FULL
2057
- self .backup_node (backup_dir ,'replica ' ,replica ,options = ['--stream' ])
2045
+ self .backup_node (backup_dir ,'node ' ,node ,options = ['--stream' ])
2058
2046
2059
2047
node .safe_psql (
2060
2048
"postgres" ,
@@ -2064,7 +2052,7 @@ def test_archive_pg_receivexlog_partial_handling(self):
2064
2052
2065
2053
# PAGE
2066
2054
self .backup_node (
2067
- backup_dir ,'replica ' ,replica ,backup_type = 'delta ' ,options = ['--stream' ])
2055
+ backup_dir ,'node ' ,node ,backup_type = 'page ' ,options = ['--stream' ])
2068
2056
2069
2057
node .safe_psql (
2070
2058
"postgres" ,
@@ -2077,16 +2065,10 @@ def test_archive_pg_receivexlog_partial_handling(self):
2077
2065
node_restored .cleanup ()
2078
2066
2079
2067
self .restore_node (
2080
- backup_dir ,'replica ' ,node_restored ,
2081
- node_restored . data_dir , options = ['--recovery-target=latest' ,'--recovery-target-action=promote' ])
2068
+ backup_dir ,'node ' ,node_restored , node_restored . data_dir ,
2069
+ options = ['--recovery-target=latest' ,'--recovery-target-action=promote' ])
2082
2070
self .set_auto_conf (node_restored , {'port' :node_restored .port })
2083
2071
self .set_auto_conf (node_restored , {'hot_standby' :'off' })
2084
- self .set_auto_conf (node_restored , {'synchronous_standby_names' :app_name })
2085
-
2086
- # it will set node_restored as warm standby.
2087
- # with open(os.path.join(node_restored.data_dir, "standby.signal"), 'w') as f:
2088
- # f.flush()
2089
- # f.close()
2090
2072
2091
2073
node_restored .slow_start ()
2092
2074