@@ -1071,9 +1071,7 @@ def test_continue_failed_merge(self):
10711071gdb .set_breakpoint ('copy_file' )
10721072gdb .run_until_break ()
10731073
1074- if gdb .continue_execution_until_break (20 )!= 'breakpoint-hit' :
1075- print ('Failed to hit breakpoint' )
1076- exit (1 )
1074+ gdb .continue_execution_until_break (20 )
10771075
10781076gdb ._execute ('signal SIGKILL' )
10791077
@@ -1154,9 +1152,7 @@ def test_continue_failed_merge_with_corrupted_delta_backup(self):
11541152gdb .set_breakpoint ('copy_file' )
11551153gdb .run_until_break ()
11561154
1157- if gdb .continue_execution_until_break (2 )!= 'breakpoint-hit' :
1158- print ('Failed to hit breakpoint' )
1159- exit (1 )
1155+ gdb .continue_execution_until_break (2 )
11601156
11611157gdb ._execute ('signal SIGKILL' )
11621158
@@ -1252,9 +1248,7 @@ def test_continue_failed_merge_2(self):
12521248gdb .set_breakpoint ('fio_unlink' )
12531249gdb .run_until_break ()
12541250
1255- if gdb .continue_execution_until_break (20 )!= 'breakpoint-hit' :
1256- print ('Failed to hit breakpoint' )
1257- exit (1 )
1251+ gdb .continue_execution_until_break (20 )
12581252
12591253gdb ._execute ('signal SIGKILL' )
12601254
@@ -1333,6 +1327,48 @@ def test_merge_different_compression_algo(self):
13331327
13341328self .del_test_dir (module_name ,fname )
13351329
1330+ def test_merge_different_wal_modes (self ):
1331+ """
1332+ Check that backups with different wal modes can be merged
1333+ correctly
1334+ """
1335+ fname = self .id ().split ('.' )[3 ]
1336+ backup_dir = os .path .join (self .tmp_path ,module_name ,fname ,'backup' )
1337+ node = self .make_simple_node (
1338+ base_dir = os .path .join (module_name ,fname ,'node' ),
1339+ set_replication = True ,
1340+ initdb_params = ['--data-checksums' ])
1341+
1342+ self .init_pb (backup_dir )
1343+ self .add_instance (backup_dir ,'node' ,node )
1344+ self .set_archiving (backup_dir ,'node' ,node )
1345+ node .slow_start ()
1346+
1347+ # FULL stream backup
1348+ self .backup_node (
1349+ backup_dir ,'node' ,node ,options = ['--stream' ])
1350+
1351+ # DELTA archive backup
1352+ backup_id = self .backup_node (
1353+ backup_dir ,'node' ,node ,backup_type = 'delta' )
1354+
1355+ self .merge_backup (backup_dir ,'node' ,backup_id = backup_id )
1356+
1357+ self .assertEqual (
1358+ 'ARCHIVE' ,self .show_pb (backup_dir ,'node' ,backup_id )['wal' ])
1359+
1360+ # DELTA stream backup
1361+ backup_id = self .backup_node (
1362+ backup_dir ,'node' ,node ,
1363+ backup_type = 'delta' ,options = ['--stream' ])
1364+
1365+ self .merge_backup (backup_dir ,'node' ,backup_id = backup_id )
1366+
1367+ self .assertEqual (
1368+ 'STREAM' ,self .show_pb (backup_dir ,'node' ,backup_id )['wal' ])
1369+
1370+ self .del_test_dir (module_name ,fname )
1371+
13361372# 1. always use parent link when merging (intermediates may be from different chain)
13371373# 2. page backup we are merging with may disappear after failed merge,
13381374# it should not be possible to continue merge after that