@@ -2243,3 +2243,58 @@ def test_pg_10_waldir(self):
2243
2243
2244
2244
# Clean after yourself
2245
2245
self .del_test_dir (module_name , fname )
2246
+
2247
+ # @unittest.skip("skip")
2248
+ def test_restore_concurrent_drop_table (self ):
2249
+ """"""
2250
+ fname = self .id ().split ('.' )[3 ]
2251
+ backup_dir = os .path .join (self .tmp_path , module_name , fname , 'backup' )
2252
+ node = self .make_simple_node (
2253
+ base_dir = os .path .join (module_name , fname , 'node' ),
2254
+ set_replication = True ,
2255
+ initdb_params = ['--data-checksums' ])
2256
+
2257
+ self .init_pb (backup_dir )
2258
+ self .add_instance (backup_dir , 'node' , node )
2259
+ self .set_archiving (backup_dir , 'node' , node )
2260
+ node .slow_start ()
2261
+
2262
+ node .pgbench_init (scale = 1 )
2263
+
2264
+ # FULL backup
2265
+ self .backup_node (
2266
+ backup_dir , 'node' , node ,
2267
+ options = ['--stream' , '--compress' ])
2268
+
2269
+ # DELTA backup
2270
+ gdb = self .backup_node (
2271
+ backup_dir , 'node' , node , backup_type = 'delta' ,
2272
+ options = ['--stream' , '--compress' , '--no-validate' ],
2273
+ gdb = True )
2274
+
2275
+ gdb .set_breakpoint ('backup_data_file' )
2276
+ gdb .run_until_break ()
2277
+
2278
+ node .safe_psql (
2279
+ 'postgres' ,
2280
+ 'DROP TABLE pgbench_accounts' )
2281
+
2282
+ # do checkpoint to guarantee filenode removal
2283
+ node .safe_psql (
2284
+ 'postgres' ,
2285
+ 'CHECKPOINT' )
2286
+
2287
+ gdb .remove_all_breakpoints ()
2288
+ gdb .continue_execution_until_exit ()
2289
+
2290
+ pgdata = self .pgdata_content (node .data_dir )
2291
+ node .cleanup ()
2292
+
2293
+ self .restore_node (
2294
+ backup_dir , 'node' , node , options = ['--no-validate' ])
2295
+
2296
+ pgdata_restored = self .pgdata_content (node .data_dir )
2297
+ self .compare_pgdata (pgdata , pgdata_restored )
2298
+
2299
+ # Clean after yourself
2300
+ self .del_test_dir (module_name , fname )
0 commit comments