shouldn't we log permission errors when accessing the configured trigger file?

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: shouldn't we log permission errors when accessing the configured trigger file?
Date: 2014-01-26 18:03:52
Message-ID: 20140126180352.GJ30218@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

For some reason CheckForStandbyTrigger() doesn't report permission
errors when stat()int the trigger file. Shouldn't we fix that?

static bool
CheckForStandbyTrigger(void)
{
...
if (stat(TriggerFile, &stat_buf) == 0)
{
ereport(LOG,
(errmsg("trigger file found: %s", TriggerFile)));
unlink(TriggerFile);
triggered = true;
fast_promote = true;
return true;
}

Imo the stat() should warn about all errors but ENOENT?

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2014-01-26 18:03:57 Re: running make check with only specified tests
Previous Message Andres Freund 2014-01-26 17:45:14 Re: Recovery inconsistencies, standby much larger than primary