EINTR causes panic (data dir on btrfs)

From: Gustavo Lopes <gustavo(at)thehyve(dot)nl>
To: pgsql-general(at)postgresql(dot)org
Subject: EINTR causes panic (data dir on btrfs)
Date: 2015-02-11 15:19:48
Message-ID: 54DB7314.8040607@thehyve.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Every few weeks, I'm getting a error like this:

> 2015-02-11 15:31:00 CET PANIC: could not write to log file 00000001000000070000007D at offset 1335296, length 8192: Interrupted system call
> 2015-02-11 15:31:00 CET STATEMENT: COMMIT
> 2015-02-11 15:31:17 CET LOG: server process (PID 8390) was terminated by signal 6: Aborted
> 2015-02-11 15:31:17 CET DETAIL: Failed process was running: COMMIT
> 2015-02-11 15:31:17 CET LOG: terminating any other active server processes
> 2015-02-11 15:31:17 CET WARNING: terminating connection because of crash of another server proces

I'm running the Ubuntu 9.3.4-1 package on a 3.2.13 kernel.

Is there any solution for this? The code generating the error seems to
be this:

> if (write(openLogFile, from, nbytes) != nbytes)
> {
> /* if write didn't set errno, assume no disk space */
> if (errno == 0)
> errno = ENOSPC;
> ereport(PANIC,
> (errcode_for_file_access(),
> errmsg("could not write to log file %s "
> "at offset %u, length %lu: %m",
> XLogFileNameP(ThisTimeLineID, openLogSegNo),
> openLogOff, (unsigned long) nbytes)));
> }

which strikes me as a bit strange (but there may be data consistency
issues I'm not aware of). Why wouldn't postgres retry on EINTR or even
allow return values of write() lower than nbytes (and then continue in a
loop).

--
Gustavo Lopes

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2015-02-11 15:26:32 Re: Cluster seems broken after pg_basebackup
Previous Message Saimon Lim 2015-02-11 09:54:16 How to hide stored procedure's bodies from specific user