mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-08-23 19:37:18 +02:00
Remove race-prone hot_standby_feedback test cases in 001_stream_rep.pl.
This script supposed that if it turned hot_standby_feedback on and then shut down the standby server, at least one feedback message would be guaranteed to be sent before the standby stops. But there is no such guarantee, if the standby's walreceiver process is slow enough --- and we've seen multiple failures in the buildfarm showing that that does happen in practice. While we could rearrange the walreceiver logic to make it less likely, it seems probably impossible to create a really bulletproof guarantee of that sort; and if we tried, we might create situations where the walreceiver wouldn't react in a timely manner to shutdown commands. It seems better instead to remove the script's assumption that feedback will occur before shutdown. But once we do that, these last few tests seem quite redundant with the earlier tests in the script. So let's just drop them altogether and save some buildfarm cycles. Backpatch to v10 where these tests were added. Discussion: https://postgr.es/m/1922.1531592205@sss.pgh.pa.us
This commit is contained in:
parent
eb00eb4e8c
commit
ade18277a0
@ -3,7 +3,7 @@ use strict;
|
|||||||
use warnings;
|
use warnings;
|
||||||
use PostgresNode;
|
use PostgresNode;
|
||||||
use TestLib;
|
use TestLib;
|
||||||
use Test::More tests => 28;
|
use Test::More tests => 26;
|
||||||
|
|
||||||
# Initialize master node
|
# Initialize master node
|
||||||
my $node_master = get_new_node('master');
|
my $node_master = get_new_node('master');
|
||||||
@ -282,27 +282,3 @@ is($catalog_xmin, '',
|
|||||||
is($xmin, '', 'xmin of cascaded slot null with hs feedback reset');
|
is($xmin, '', 'xmin of cascaded slot null with hs feedback reset');
|
||||||
is($catalog_xmin, '',
|
is($catalog_xmin, '',
|
||||||
'catalog xmin of cascaded slot still null with hs_feedback reset');
|
'catalog xmin of cascaded slot still null with hs_feedback reset');
|
||||||
|
|
||||||
note "re-enabling hot_standby_feedback and disabling while stopped";
|
|
||||||
$node_standby_2->safe_psql('postgres',
|
|
||||||
'ALTER SYSTEM SET hot_standby_feedback = on;');
|
|
||||||
$node_standby_2->reload;
|
|
||||||
|
|
||||||
$node_master->safe_psql('postgres', qq[INSERT INTO tab_int VALUES (11000);]);
|
|
||||||
replay_check();
|
|
||||||
|
|
||||||
$node_standby_2->safe_psql('postgres',
|
|
||||||
'ALTER SYSTEM SET hot_standby_feedback = off;');
|
|
||||||
$node_standby_2->stop;
|
|
||||||
|
|
||||||
($xmin, $catalog_xmin) =
|
|
||||||
get_slot_xmins($node_standby_1, $slotname_2, "xmin IS NOT NULL");
|
|
||||||
isnt($xmin, '', 'xmin of cascaded slot non-null with postgres shut down');
|
|
||||||
|
|
||||||
# Xmin from a previous run should be cleared on startup.
|
|
||||||
$node_standby_2->start;
|
|
||||||
|
|
||||||
($xmin, $catalog_xmin) =
|
|
||||||
get_slot_xmins($node_standby_1, $slotname_2, "xmin IS NULL");
|
|
||||||
is($xmin, '',
|
|
||||||
'xmin of cascaded slot reset after startup with hs feedback reset');
|
|
||||||
|
Loading…
Reference in New Issue
Block a user