diff options
Diffstat (limited to 'src/test/modules')
4 files changed, 26 insertions, 14 deletions
diff --git a/src/test/modules/injection_points/specs/reindex-concurrently-upsert-on-constraint.spec b/src/test/modules/injection_points/specs/reindex-concurrently-upsert-on-constraint.spec index 8126256460c..4bbdda3cf04 100644 --- a/src/test/modules/injection_points/specs/reindex-concurrently-upsert-on-constraint.spec +++ b/src/test/modules/injection_points/specs/reindex-concurrently-upsert-on-constraint.spec @@ -85,7 +85,7 @@ step s4_wakeup_to_set_dead permutation s3_setup_wait_before_set_dead s3_start_reindex(s1_start_upsert, s2_start_upsert) - s1_start_upsert + s1_start_upsert(s4_wakeup_s2) s4_wakeup_to_set_dead s2_start_upsert(s1_start_upsert) s4_wakeup_s1 @@ -94,7 +94,7 @@ permutation permutation s3_setup_wait_before_swap s3_start_reindex(s1_start_upsert, s2_start_upsert) - s1_start_upsert + s1_start_upsert(s4_wakeup_s2) s4_wakeup_to_swap s2_start_upsert(s1_start_upsert) s4_wakeup_s2 @@ -103,7 +103,7 @@ permutation permutation s3_setup_wait_before_set_dead s3_start_reindex(s1_start_upsert, s2_start_upsert) - s1_start_upsert + s1_start_upsert(s4_wakeup_s2) s2_start_upsert(s1_start_upsert) s4_wakeup_s1 s4_wakeup_to_set_dead diff --git a/src/test/modules/injection_points/specs/reindex-concurrently-upsert-partitioned.spec b/src/test/modules/injection_points/specs/reindex-concurrently-upsert-partitioned.spec index b57e11f3947..c3504b9ef38 100644 --- a/src/test/modules/injection_points/specs/reindex-concurrently-upsert-partitioned.spec +++ b/src/test/modules/injection_points/specs/reindex-concurrently-upsert-partitioned.spec @@ -88,7 +88,7 @@ step s4_wakeup_to_set_dead permutation s3_setup_wait_before_set_dead s3_start_reindex(s1_start_upsert, s2_start_upsert) - s1_start_upsert + s1_start_upsert(s4_wakeup_s2) s4_wakeup_to_set_dead s2_start_upsert(s1_start_upsert) s4_wakeup_s1 @@ -97,7 +97,7 @@ permutation permutation s3_setup_wait_before_swap s3_start_reindex(s1_start_upsert, s2_start_upsert) - s1_start_upsert + s1_start_upsert(s4_wakeup_s2) s4_wakeup_to_swap s2_start_upsert(s1_start_upsert) s4_wakeup_s2 @@ -106,7 +106,7 @@ permutation permutation s3_setup_wait_before_set_dead s3_start_reindex(s1_start_upsert, s2_start_upsert) - s1_start_upsert + s1_start_upsert(s4_wakeup_s2) s2_start_upsert(s1_start_upsert) s4_wakeup_s1 s4_wakeup_to_set_dead diff --git a/src/test/modules/injection_points/specs/reindex-concurrently-upsert.spec b/src/test/modules/injection_points/specs/reindex-concurrently-upsert.spec index f12b2fca486..1b043a48ff4 100644 --- a/src/test/modules/injection_points/specs/reindex-concurrently-upsert.spec +++ b/src/test/modules/injection_points/specs/reindex-concurrently-upsert.spec @@ -86,7 +86,7 @@ step s4_wakeup_to_set_dead permutation s3_setup_wait_before_set_dead s3_start_reindex(s1_start_upsert, s2_start_upsert) - s1_start_upsert + s1_start_upsert(s4_wakeup_s2) s4_wakeup_to_set_dead s2_start_upsert(s1_start_upsert) s4_wakeup_s1 @@ -95,7 +95,7 @@ permutation permutation s3_setup_wait_before_swap s3_start_reindex(s1_start_upsert, s2_start_upsert) - s1_start_upsert + s1_start_upsert(s4_wakeup_s2) s4_wakeup_to_swap s2_start_upsert(s1_start_upsert) s4_wakeup_s2 @@ -104,7 +104,7 @@ permutation permutation s3_setup_wait_before_set_dead s3_start_reindex(s1_start_upsert, s2_start_upsert) - s1_start_upsert + s1_start_upsert(s4_wakeup_s2) s2_start_upsert(s1_start_upsert) s4_wakeup_s1 s4_wakeup_to_set_dead diff --git a/src/test/modules/test_slru/t/002_multixact_wraparound.pl b/src/test/modules/test_slru/t/002_multixact_wraparound.pl index de37d845b11..169333fc564 100644 --- a/src/test/modules/test_slru/t/002_multixact_wraparound.pl +++ b/src/test/modules/test_slru/t/002_multixact_wraparound.pl @@ -25,19 +25,31 @@ command_ok( ], "set the cluster's next multitransaction to 0xFFFFFFF8"); +# Extract a few values from pg_resetwal --dry-run output that we need for +# the calculations below +my $out = (run_command([ 'pg_resetwal', '--dry-run', $node->data_dir ]))[0]; +$out =~ /^Database block size: *(\d+)$/m or die; +my $blcksz = $1; +$out =~ /^Pages per SLRU segment: *(\d+)$/m or die; +my $slru_pages_per_segment = $1; + # Fixup the SLRU files to match the state we reset to. -# initialize SLRU file with zeros (65536 entries * 4 bytes = 262144 bytes) -my $slru_file = "$node_pgdata/pg_multixact/offsets/FFFF"; +# initialize the 'offsets' SLRU file containing the new next multixid +# with zeros +my $multixact_offsets_per_page = $blcksz / 4; # sizeof(MultiXactOffset) == 4 +my $segno = + int(0xFFFFFFF8 / $multixact_offsets_per_page / $slru_pages_per_segment); +my $slru_file = sprintf('%s/pg_multixact/offsets/%04X', $node_pgdata, $segno); open my $fh, ">", $slru_file or die "could not open \"$slru_file\": $!"; binmode $fh; -# Write 65536 entries of 4 bytes each (all zeros) -syswrite($fh, "\0" x 262144) == 262144 +my $bytes_per_seg = $slru_pages_per_segment * $blcksz; +syswrite($fh, "\0" x $bytes_per_seg) == $bytes_per_seg or die "could not write to \"$slru_file\": $!"; close $fh; -# remove old SLRU file +# remove old file unlink("$node_pgdata/pg_multixact/offsets/0000") or die "could not unlink \"$node_pgdata/pg_multixact/offsets/0000\": $!"; |
