waiting for reload in tests - Mailing list pgsql-hackers

From Andres Freund
Subject waiting for reload in tests
Date
Msg-id 20220510012657.63pkv4tfzsmhvy5i@alap3.anarazel.de
Whole thread Raw
Responses Re: waiting for reload in tests
List pgsql-hackers
Hi,

In a couple tests I (IIRC others as well) had the problem that a config reload
isn't actually synchronous. I.e. a sequence like

$node_primary->reload;
$node_primary->safe_psql('postgres',...)

isn't actually guaranteed to observe the config as reloaded in the the
safe_psql(). It *typically* will see the new config results, but if the system
busy and/or slow, the sighup might not yet have been propagated by postmaster
and/or not yet received by the relevant process.

I don't really see a way to guarantee this with reasonable effort in the
back-branches. In HEAD we could (with some difficulties around postmaster and
UI) use a global barrier to wait for the reload to complete. For the
backbranches I guess we could hack something using retries and setting a
pseudo-guc to check whether the reload has been processed - but that's not
bulletproof at all, some process(es) could take longer to receive the signal.

Anybody got a better idea?

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: KAWAMOTO Masaya
Date:
Subject: Proposal: add a debug message about using geqo
Next
From: Tom Lane
Date:
Subject: Re: waiting for reload in tests