pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Adjust initdb to also not consider fsync'ing failures fatal.
6+ messages / 2 participants
[nested] [flat]

* pgsql: Adjust initdb to also not consider fsync'ing failures fatal.
@ 2015-05-29 17:05 Tom Lane <tgl@sss.pgh.pa.us>
  2015-05-29 19:59 ` Re: pgsql: Adjust initdb to also not consider fsync'ing failures fatal. Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 1 reply; 6+ messages in thread

From: Tom Lane @ 2015-05-29 17:05 UTC (permalink / raw)
  To: pgsql-committers

Adjust initdb to also not consider fsync'ing failures fatal.

Make initdb's version of this logic look as much like the backend's
as possible.  This is much less critical than in the backend since not
so many people use "initdb -S", but we want the same corner-case error
handling in both cases.

Back-patch to 9.3 where initdb -S option was introduced.  Before that,
initdb only had to deal with freshly-created data directories, wherein
no failures should be expected.

Abhijit Menon-Sen

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/c07d8c963e39980f192e8daca73b7585ef76cc9b

Modified Files
--------------
src/bin/initdb/initdb.c |  306 ++++++++++++++++++++++++-----------------------
1 file changed, 155 insertions(+), 151 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: Adjust initdb to also not consider fsync'ing failures fatal.
  2015-05-29 17:05 pgsql: Adjust initdb to also not consider fsync'ing failures fatal. Tom Lane <tgl@sss.pgh.pa.us>
@ 2015-05-29 19:59 ` Peter Eisentraut <peter_e@gmx.net>
  2015-05-29 20:06   ` Re: pgsql: Adjust initdb to also not consider fsync'ing failures fatal. Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 6+ messages in thread

From: Peter Eisentraut @ 2015-05-29 19:59 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-committers

On 5/29/15 1:05 PM, Tom Lane wrote:
> Adjust initdb to also not consider fsync'ing failures fatal.

This introduces a failure in the initdb tests, which expect that

    initdb -S -D /notthere

returns a nonzero exit code.

The output of that command is also a bit crazy now:

$ pg-install/bin/initdb -S -D /notthere
syncing data to disk ... initdb: could not stat file
"/notthere/pg_xlog": No such file or directory
initdb: could not open directory "/notthere": No such file or directory
initdb: could not open directory "/notthere/pg_tblspc": No such file or
directory
ok


I think the behavior to ignore fsync failures should probably not apply
to top-level directories.  Or alternatively, the existence of these
directories should be checked separately.



-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: Adjust initdb to also not consider fsync'ing failures fatal.
  2015-05-29 17:05 pgsql: Adjust initdb to also not consider fsync'ing failures fatal. Tom Lane <tgl@sss.pgh.pa.us>
  2015-05-29 19:59 ` Re: pgsql: Adjust initdb to also not consider fsync'ing failures fatal. Peter Eisentraut <peter_e@gmx.net>
@ 2015-05-29 20:06   ` Tom Lane <tgl@sss.pgh.pa.us>
  2015-05-30 02:14     ` Re: pgsql: Adjust initdb to also not consider fsync'ing failures fatal. Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 1 reply; 6+ messages in thread

From: Tom Lane @ 2015-05-29 20:06 UTC (permalink / raw)
  To: Peter Eisentraut <peter_e@gmx.net>; +Cc: pgsql-committers

Peter Eisentraut <peter_e@gmx.net> writes:
> On 5/29/15 1:05 PM, Tom Lane wrote:
>> Adjust initdb to also not consider fsync'ing failures fatal.

> This introduces a failure in the initdb tests, which expect that
>     initdb -S -D /notthere
> returns a nonzero exit code.

Hm, I guess we don't run anything else that touches the DB directory
in this case?  In the backend case we'd have failed much earlier.

I'm not 100% convinced that the test case's expectation is necessarily
the right thing, though.

			regards, tom lane


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: Adjust initdb to also not consider fsync'ing failures fatal.
  2015-05-29 17:05 pgsql: Adjust initdb to also not consider fsync'ing failures fatal. Tom Lane <tgl@sss.pgh.pa.us>
  2015-05-29 19:59 ` Re: pgsql: Adjust initdb to also not consider fsync'ing failures fatal. Peter Eisentraut <peter_e@gmx.net>
  2015-05-29 20:06   ` Re: pgsql: Adjust initdb to also not consider fsync'ing failures fatal. Tom Lane <tgl@sss.pgh.pa.us>
@ 2015-05-30 02:14     ` Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 0 replies; 6+ messages in thread

From: Peter Eisentraut @ 2015-05-30 02:14 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers

On 5/29/15 4:06 PM, Tom Lane wrote:
> Peter Eisentraut <peter_e@gmx.net> writes:
>> On 5/29/15 1:05 PM, Tom Lane wrote:
>>> Adjust initdb to also not consider fsync'ing failures fatal.
> 
>> This introduces a failure in the initdb tests, which expect that
>>     initdb -S -D /notthere
>> returns a nonzero exit code.
> 
> Hm, I guess we don't run anything else that touches the DB directory
> in this case?  In the backend case we'd have failed much earlier.

Yeah, in the backend, there are various checks earlier that the data
directory exists.

> I'm not 100% convinced that the test case's expectation is necessarily
> the right thing, though.

Well, I think a tool

    do_something DIRECTORY

that just prints out error messages and says "ok" without an error code
when the directory doesn't exist is a pretty crappy behavior.

The premise of this change was that we don't know what all the files in
the data directory might be, but we do know what the top-level directory
is, so we should treat that properly.



-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Adjust initdb to also not consider fsync'ing failures fatal.
@ 2015-05-29 17:05 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2015-05-29 17:05 UTC (permalink / raw)
  To: pgsql-committers

Adjust initdb to also not consider fsync'ing failures fatal.

Make initdb's version of this logic look as much like the backend's
as possible.  This is much less critical than in the backend since not
so many people use "initdb -S", but we want the same corner-case error
handling in both cases.

Back-patch to 9.3 where initdb -S option was introduced.  Before that,
initdb only had to deal with freshly-created data directories, wherein
no failures should be expected.

Abhijit Menon-Sen

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/dbde225b144890fb5a40e21f8f624de18ead2f95

Modified Files
--------------
src/bin/initdb/initdb.c |  306 ++++++++++++++++++++++++-----------------------
1 file changed, 155 insertions(+), 151 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Adjust initdb to also not consider fsync'ing failures fatal.
@ 2015-05-29 17:05 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2015-05-29 17:05 UTC (permalink / raw)
  To: pgsql-committers

Adjust initdb to also not consider fsync'ing failures fatal.

Make initdb's version of this logic look as much like the backend's
as possible.  This is much less critical than in the backend since not
so many people use "initdb -S", but we want the same corner-case error
handling in both cases.

Back-patch to 9.3 where initdb -S option was introduced.  Before that,
initdb only had to deal with freshly-created data directories, wherein
no failures should be expected.

Abhijit Menon-Sen

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/52fc948444dde2d10f261e66766e6842231a9d46

Modified Files
--------------
src/bin/initdb/initdb.c |  306 ++++++++++++++++++++++++-----------------------
1 file changed, 155 insertions(+), 151 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2015-05-30 02:14 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-05-29 17:05 pgsql: Adjust initdb to also not consider fsync'ing failures fatal. Tom Lane <tgl@sss.pgh.pa.us>
2015-05-29 19:59 ` Peter Eisentraut <peter_e@gmx.net>
2015-05-29 20:06   ` Tom Lane <tgl@sss.pgh.pa.us>
2015-05-30 02:14     ` Peter Eisentraut <peter_e@gmx.net>
2015-05-29 17:05 pgsql: Adjust initdb to also not consider fsync'ing failures fatal. Tom Lane <tgl@sss.pgh.pa.us>
2015-05-29 17:05 pgsql: Adjust initdb to also not consider fsync'ing failures fatal. Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox