Question about 001_stream_rep.pl recovery test

From: David Zhang <david(dot)zhang(at)highgo(dot)ca>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Question about 001_stream_rep.pl recovery test
Date: 2021-12-10 21:44:40
Message-ID: 7c1c43e3-7253-47fd-cf0c-d69e72d63717@highgo.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Hackers,

Inside the test script `src/test/recovery/t/001_stream_rep.pl`, a
comment at line 30 says `my_backup` is "not mandatory",

 30 # Take backup of standby 1 (not mandatory, but useful to check if
 31 # pg_basebackup works on a standby).
 32 $node_standby_1->backup($backup_name);

however if remove the backup folder "my_backup" after line 32, something
like below,

 33 system_or_bail('rm', '-rf',
'/home/user/postgres/src/test/recovery/tmp_check/t_001_stream_rep_standby_1_data/backup/my_backup');

then the test failed with message like,

recovery$ make check PROVE_TESTS='t/001_stream_rep.pl'
t/001_stream_rep.pl .. # Looks like your test exited with 2 before it
could output anything.
t/001_stream_rep.pl .. Dubious, test returned 2 (wstat 512, 0x200)
Failed 53/53 subtests
... ...
Result: FAIL
Makefile:23: recipe for target 'check' failed
make: *** [check] Error 1

And then the test script takes another backup `my_backup_2`, but it
seems this backup is not used anywhere.

 35 # Take a second backup of the standby while the primary is offline.
 36 $node_primary->stop;
 37 $node_standby_1->backup('my_backup_2');
 38 $node_primary->start;

because, if I deleted the backup "my_backup_2" right after line 38 with
something like below,

39 system_or_bail('rm', '-rf',
'/home/user/postgres/src/test/recovery/tmp_check/t_001_stream_rep_standby_1_data/backup/my_backup_2');
there is no impact on the test result, and it says all test cases passed.

recovery$ make check PROVE_TESTS='t/001_stream_rep.pl'
...
t/001_stream_rep.pl .. ok
All tests successful.
Files=1, Tests=53,  6 wallclock secs ( 0.01 usr  0.01 sys + 1.00 cusr 
0.82 csys =  1.84 CPU)
Result: PASS

Did I misunderstand something here?

Thank you,

--
David

Software Engineer
Highgo Software Inc. (Canada)
www.highgo.ca

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2021-12-10 21:48:00 Re: Removing more vacuumlazy.c special cases, relfrozenxid optimizations
Previous Message Alvaro Herrera 2021-12-10 21:08:24 Re: Column Filtering in Logical Replication