diff options
author | Michael Paquier <michael@paquier.xyz> | 2019-03-13 14:58:24 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2019-03-13 14:58:24 +0900 |
commit | b0825d28ea83e44139bd319e6d1db2c499cd4c6a (patch) | |
tree | b70c5a836912be7734fb565350750b60743aa4ac /src/test/perl/TestLib.pm | |
parent | 6dd263cfaa8447470af4fae3f61c47438f91d71f (diff) | |
download | postgresql-b0825d28ea83e44139bd319e6d1db2c499cd4c6a.tar.gz postgresql-b0825d28ea83e44139bd319e6d1db2c499cd4c6a.zip |
Add TAP test to check consistency of minimum recovery LSN
c186ba13 has fixed an issue related to the updates of the minimum
recovery LSN across multiple processes on standbys, but we never really
had a test case able to reliably check its logic.
This commit introduces a new test case to close the gap, and is designed
to check the consistency of data based on the minimum recovery point set
by either the startup process or the checkpointer for both an offline
cluster (by looking at the on-disk page headers) and an online cluster
(using pageinspect).
Note that with c186ba13 reverted, this test fails badly for both the
online and offline cases, as designed.
Author: Michael Paquier, Andrew Gierth
Reviewed-by: Andrew Gierth, Georgios Kokolatos, Arthur Zakirov
Discussion: https://postgr.es/m/20181108044525.GA17482@paquier.xyz
Diffstat (limited to 'src/test/perl/TestLib.pm')
-rw-r--r-- | src/test/perl/TestLib.pm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/perl/TestLib.pm b/src/test/perl/TestLib.pm index b9cb51b9d39..ce59401cefa 100644 --- a/src/test/perl/TestLib.pm +++ b/src/test/perl/TestLib.pm @@ -36,6 +36,7 @@ our @EXPORT = qw( system_or_bail system_log run_log + run_command command_ok command_fails @@ -203,6 +204,16 @@ sub run_log return IPC::Run::run(@_); } +sub run_command +{ + my ($cmd) = @_; + my ($stdout, $stderr); + my $result = IPC::Run::run $cmd, '>', \$stdout, '2>', \$stderr; + chomp($stdout); + chomp($stderr); + return ($stdout, $stderr); +} + # Generate a string made of the given range of ASCII characters sub generate_ascii_string { |