Re: START_REPLICATION SLOT causing a crash in an assert build - Mailing list pgsql-hackers

From Andres Freund
Subject Re: START_REPLICATION SLOT causing a crash in an assert build
Date
Msg-id 20221012162143.qlxojaybbyok4v7m@awork3.anarazel.de
Whole thread Raw
In response to Re: START_REPLICATION SLOT causing a crash in an assert build  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Responses Re: START_REPLICATION SLOT causing a crash in an assert build  (Masahiko Sawada <sawada.mshk@gmail.com>)
List pgsql-hackers
Hi,

On 2022-10-11 17:10:52 +0900, Masahiko Sawada wrote:
> +# Reset the replication slot statistics.
> +$node->safe_psql('postgres',
> +    "SELECT pg_stat_reset_replication_slot('regression_slot');");
> +my $result = $node->safe_psql('postgres',
> +    "SELECT * FROM pg_stat_replication_slots WHERE slot_name = 'regrssion_slot'"
> +);

Typo in the slot name "regrssion_slot" instead of "regression_slot". We can't
use * here, because that'll include the reset timestamp.


> +# Teardown the node so the statistics is removed.
> +$pg_recvlogical->kill_kill;
> +$node->teardown_node;
> +$node->start;

ISTM that removing the file instead of shutting down the cluster with force
would make it a more targeted test.


> +# Check if the replication slot statistics have been removed.
> +$result = $node->safe_psql('postgres',
> +    "SELECT * FROM pg_stat_replication_slots WHERE slot_name = 'regrssion_slot'"
> +);
> +is($result, "", "replication slot statistics are removed");

Same typo as above. We can't assert a specific result here either, because
recvlogical will have processed a bunch of changes. Perhaps we could check at
least that the reset time is NULL? 


> +# Test if the replication slot staistics continue to be accumulated even after

s/staistics/statistics/

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: make_ctags: use -I option to ignore pg_node_attr macro
Next
From: Jacob Champion
Date:
Subject: Re: [PoC] Let libpq reject unexpected authentication requests