Re: Is it OK to ignore directory open failure inResetUnloggedRelations? - Mailing list pgsql-hackers

From Justin Pryzby
Subject Re: Is it OK to ignore directory open failure inResetUnloggedRelations?
Date
Msg-id 20171205050127.GI28855@telsasoft.com
Whole thread Raw
In response to Is it OK to ignore directory open failure in ResetUnloggedRelations?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Dec 04, 2017 at 03:15:08PM -0500, Tom Lane wrote:
> While working through Michael Paquier's patch to clean up inconsistent
> usage of AllocateDir(), I noticed that ResetUnloggedRelations and its
> subroutines are not consistent about whether a directory open failure
> results in erroring out or just emitting a LOG message and continuing.
> ResetUnloggedRelations itself throws a hard error if it fails to open
> pg_tblspc, but all the rest of reinit.c thinks a LOG message is
> sufficient.
...
> So now I'm thinking we should do the reverse and change these functions
> to give a hard error on AllocateDir failure.  That would result in
> startup-process failure if we are unable to scan the database, which is
> not great, but there's certainly something badly wrong if we can't.

I can offer a data point unrelated to unlogged relations.

Sometimes, following a reboot, if there's a tablespace on ZFS, and if a ZPOOL
backing device is missing/renamed (especially under qemu), postgres (if it was
shutdown cleanly) will happily start even though a tablespace is missing (due
to unable to find backing device - ZFS wants it to be exported and imported
before it scans all devices for matching UUID).

That has been surprising to me in the past and lead me to believe that
"services are up" following a reboot only to notice a bunch of ERRORs in the
logs a handful of minutes later.

Maybe that counts for a tangential +1.

Justin


pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Mention ordered datums in PartitionBoundInfoData comment
Next
From: Rajkumar Raghuwanshi
Date:
Subject: Re: [HACKERS] Partition-wise join for join between (declaratively)partitioned tables