mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-08-31 16:37:25 +02:00
Fix some issues with TAP tests of pg_basebackup
ee9e145
has fixed the tests of pg_basebackup for checksums a first time,
still one seek() call missed the shot. Also, the data written in files
to emulate corruptions was not actually writing zeros as the quoting
style was incorrect.
Author: Michael Banck
Discussion: https://postgr.es/m/1550153276.796.35.camel@credativ.de
Backpatch-through: 11
This commit is contained in:
parent
1d93d18045
commit
51be67346e
@ -502,7 +502,7 @@ my $block_size = $node->safe_psql('postgres', 'SHOW block_size;');
|
|||||||
system_or_bail 'pg_ctl', '-D', $pgdata, 'stop';
|
system_or_bail 'pg_ctl', '-D', $pgdata, 'stop';
|
||||||
open $file, '+<', "$pgdata/$file_corrupt1";
|
open $file, '+<', "$pgdata/$file_corrupt1";
|
||||||
seek($file, $pageheader_size, 0);
|
seek($file, $pageheader_size, 0);
|
||||||
syswrite($file, '\0\0\0\0\0\0\0\0\0');
|
syswrite($file, "\0\0\0\0\0\0\0\0\0");
|
||||||
close $file;
|
close $file;
|
||||||
system_or_bail 'pg_ctl', '-D', $pgdata, 'start';
|
system_or_bail 'pg_ctl', '-D', $pgdata, 'start';
|
||||||
|
|
||||||
@ -521,7 +521,7 @@ for my $i (1 .. 5)
|
|||||||
{
|
{
|
||||||
my $offset = $pageheader_size + $i * $block_size;
|
my $offset = $pageheader_size + $i * $block_size;
|
||||||
seek($file, $offset, 0);
|
seek($file, $offset, 0);
|
||||||
syswrite($file, '\0\0\0\0\0\0\0\0\0');
|
syswrite($file, "\0\0\0\0\0\0\0\0\0");
|
||||||
}
|
}
|
||||||
close $file;
|
close $file;
|
||||||
system_or_bail 'pg_ctl', '-D', $pgdata, 'start';
|
system_or_bail 'pg_ctl', '-D', $pgdata, 'start';
|
||||||
@ -537,8 +537,8 @@ rmtree("$tempdir/backup_corrupt2");
|
|||||||
# induce corruption in a second file
|
# induce corruption in a second file
|
||||||
system_or_bail 'pg_ctl', '-D', $pgdata, 'stop';
|
system_or_bail 'pg_ctl', '-D', $pgdata, 'stop';
|
||||||
open $file, '+<', "$pgdata/$file_corrupt2";
|
open $file, '+<', "$pgdata/$file_corrupt2";
|
||||||
seek($file, 4000, 0);
|
seek($file, $pageheader_size, 0);
|
||||||
syswrite($file, '\0\0\0\0\0\0\0\0\0');
|
syswrite($file, "\0\0\0\0\0\0\0\0\0");
|
||||||
close $file;
|
close $file;
|
||||||
system_or_bail 'pg_ctl', '-D', $pgdata, 'start';
|
system_or_bail 'pg_ctl', '-D', $pgdata, 'start';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user