Re: Accidental removal of a file causing various problems - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Accidental removal of a file causing various problems
Date
Msg-id 20180824193302.atba6jchedmzllnh@alvherre.pgsql
Whole thread Raw
In response to Re: Accidental removal of a file causing various problems  (Pavan Deolasee <pavan.deolasee@gmail.com>)
Responses Re: Accidental removal of a file causing various problems
List pgsql-hackers
On 2018-Aug-25, Pavan Deolasee wrote:

> The errors were simply about about the missing file. See attached
> reproduction script that I created while studying this complaint. It will
> throw errors such as:
> 
> psql: FATAL:  could not open file "base/12669/16387": No such file or
> directory
> CONTEXT:  writing block 207724 of relation base/12669/16387
> 
> Now of course, the file is really missing. But the user was quite surprised
> that they couldn't connect to any database, even though mishap happened to
> a user table in one of their reporting databases.

Hmm, that sounds like there's a bunch of dirty pages waiting to be
written to that nonexistant file, and the error prevents the starting
backend from acquiring a free page on which to read something from disk
for another relation.

> To add to their misery, while restart fixed this error and opened
> their other databases for regular operation, it caused the toast
> corruption.

Sounds like the right data was in shared buffers, but it was lost in the
shutdown.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-hackers by date:

Previous
From: Pavan Deolasee
Date:
Subject: Re: Accidental removal of a file causing various problems
Next
From: Andres Freund
Date:
Subject: Re: Accidental removal of a file causing various problems