postgresql/src/backend
Tom Lane 8dc3c971a9 Treat directory open failures as hard errors in ResetUnloggedRelations().
Previously, this code just reported such problems at LOG level and kept
going.  The problem with this approach is that transient failures (e.g.,
ENFILE) could prevent us from resetting unlogged relations to empty,
yet allow recovery to appear to complete successfully.  That seems like
a data corruption hazard large enough to treat such problems as reasons
to fail startup.

For the same reason, treat unlink failures for unlogged files as hard
errors not just LOG messages.  It's a little odd that we did it like that
when file-level errors in other steps (copy_file, fsync_fname) are ERRORs.

The sole case that I left alone is that ENOENT failure on a tablespace
(not database) directory is not an error, though it will now be logged
rather than just silently ignored.  This is to cover the scenario where
a previous DROP TABLESPACE removed the tablespace directory but failed
before removing the pg_tblspc symlink.  I'm not sure that that's very
likely in practice, but that seems like the only real excuse for the
old behavior here, so let's allow for it.  (As coded, this will also
allow ENOENT on $PGDATA/base/.  But since we'll fail soon enough if
that's gone, I don't think we need to complicate this code by
distinguishing that from a true tablespace case.)

Discussion: https://postgr.es/m/21040.1512418508@sss.pgh.pa.us
2017-12-04 20:52:59 -05:00
..
access Simplify do_pg_start_backup's API by opening pg_tblspc internally. 2017-12-04 18:37:54 -05:00
bootstrap Exclude flex-generated code from coverage testing 2017-10-16 16:28:11 -04:00
catalog Minor code beautification in partition_bounds_equal. 2017-12-01 13:52:59 -05:00
commands When VACUUM or ANALYZE skips a concurrently dropped table, log it. 2017-12-04 15:25:55 -05:00
executor Remove memory leak protection from Gather and Gather Merge nodes. 2017-12-04 10:39:24 -05:00
foreign Change TRUE/FALSE to true/false 2017-11-08 11:37:28 -05:00
lib Allow to avoid NUL-byte management for stringinfos and use in format.c. 2017-10-11 16:01:52 -07:00
libpq Check channel binding flag at end of SCRAM exchange 2017-12-01 09:53:26 -05:00
main Install Windows crash dump handler before all else. 2017-11-12 14:31:00 -08:00
nodes Remove extra word from comment. 2017-11-30 16:22:38 -05:00
optimizer Try to exclude partitioned tables in toto. 2017-12-01 10:59:09 -05:00
parser Re-allow INSERT .. ON CONFLICT DO NOTHING on partitioned tables. 2017-12-01 12:53:21 -05:00
po
port Add some const decorations to prototypes 2017-11-10 13:38:57 -05:00
postmaster Clean up assorted messiness around AllocateDir() usage. 2017-12-04 17:02:56 -05:00
regex Mop-up for commit 85feb77aa0. 2017-09-22 11:35:12 -04:00
replication Simplify do_pg_start_backup's API by opening pg_tblspc internally. 2017-12-04 18:37:54 -05:00
rewrite Fix creation of resjunk tlist entries for inherited mixed UPDATE/DELETE. 2017-11-27 17:54:07 -05:00
snowball Add some const decorations to prototypes 2017-11-10 13:38:57 -05:00
statistics Support boolean columns in functional-dependency statistics. 2017-12-04 11:51:43 -05:00
storage Treat directory open failures as hard errors in ResetUnloggedRelations(). 2017-12-04 20:52:59 -05:00
tcop SQL procedures 2017-11-30 11:03:20 -05:00
tsearch Update typedefs.list and re-run pgindent 2017-11-29 09:24:24 -05:00
utils Clean up assorted messiness around AllocateDir() usage. 2017-12-04 17:02:56 -05:00
.gitignore
common.mk
Makefile
nls.mk