Re: pgsql: Recursively fsync() the data directory after a crash. - Mailing list pgsql-committers

From Robert Haas
Subject Re: pgsql: Recursively fsync() the data directory after a crash.
Date
Msg-id CA+TgmobbVFXERf4Hat47aqUgt1oGGk0E9JSjCeBWg8a3sNz2mg@mail.gmail.com
Whole thread Raw
In response to Re: pgsql: Recursively fsync() the data directory after a crash.  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-committers
On Mon, May 18, 2015 at 1:00 PM, Alvaro Herrera
<alvherre@2ndquadrant.com> wrote:
> Robert Haas wrote:
>> On Mon, May 18, 2015 at 12:39 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
>> >> Uh, doesn't that change the translated strings?  Is that a problem?
>> >
>> > Better an untranslated message than a translated one that lacks critical
>> > info.  But anyway, there are likely other instances of that same string
>> > *with* %m ...
>>
>> Probably not, because of the way the message is worded.  But we could do this:
>>
>> diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
>> index 6fa75d1..bed8478 100644
>> --- a/src/backend/storage/file/fd.c
>> +++ b/src/backend/storage/file/fd.c
>> @@ -2461,7 +2461,7 @@ pre_sync_fname(char *fname, bool isdir)
>>
>>         if (fd < 0)
>>                 ereport(FATAL,
>> -                               (errmsg("could not open file \"%s\"
>> before fsync",
>> +                               (errmsg("could not open file \"%s\": %m",
>>                                                 fname)));
>>
>>         pg_flush_data(fd, 0, 0);
>>
>> Does that sound good?
>
> +1.  It's not like the extra two words of context would be of much use
> anyway.

Done.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-committers by date:

Previous
From: Robert Haas
Date:
Subject: pgsql: Fix error message in pre_sync_fname.
Next
From: Tom Lane
Date:
Subject: pgsql: Recognize "REGRESS_OPTS += ..." syntax in MSVC build scripts.