On Mon, Sep 26, 2016 at 12:54 AM, Tom Lane <t...@sss.pgh.pa.us> wrote: > Peter Eisentraut <pete...@gmx.net> writes: >> pg_ctl: Detect current standby state from pg_control > > Coverity thinks that this patch introduced a bunch of > null-pointer-dereference hazards, and AFAICS it is right. > The change in get_controlfile()'s API is completely broken > and needs to be undone.
So you'd rather have a sleep(1) and complicate this code to replace it with a WaitLatch() when the code is used by the backend? I don't agree with that as the new API is cleaner as presented, though I agree that it is a change that caller does not get any result in case of a CRC mismatch, but who's going to use results that cannot be trusted anyway? It seems to me that the correct fix here is that pg_controldata.c should just exit like in the attached patch. Somewhat I missed that during my lookup of c1dc51d4. If we would still want callers of get_controlfile() to be allowed to read untrustworthy results, we could just add a boolean status flag.. -- Michael
controldata-untrust.patch
Description: application/download
-- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers