From: Tom Lane <tgl@sss.pgh.pa.us>
To: Luca Ferrari <fluca1978@gmail.com>
Cc: Julien Rouhaud <rjuju123@gmail.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: why not using a mountpoint as PGDATA?
Date: Wed, 27 Feb 2019 10:42:12 -0500
Message-ID: <14944.1551282132@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKoxK+57m-8pugYke+BYhYtPn4YYNJgzU8g21aMykEZmMdQgQw@mail.gmail.com>
References: <CAKoxK+6H40imynM5P31bf0DnpN-5f5zeROjcaj6BKVAjxdEA9w@mail.gmail.com>
<CAOBaU_aAp0gDP_ovqL2aDd_80bDHn805oL-dROxDCb9q4ySqxg@mail.gmail.com>
<CAKoxK+57m-8pugYke+BYhYtPn4YYNJgzU8g21aMykEZmMdQgQw@mail.gmail.com>
Luca Ferrari <fluca1978@gmail.com> writes:
> On Wed, Feb 27, 2019 at 12:33 PM Julien Rouhaud <rjuju123@gmail.com> wrote:
>> You can see most obvious reasons at
>> https://bugzilla.redhat.com/show_bug.cgi?id=1247477> Thanks, I didn't see the lost+found problem because I'm on UFS (I'm
> wondering if this applies also to ZFS datasetes with mount point).
> Same story for the accidentally umount, since FreeBSD seems enough
> friendly to avoid umount while the database is running, but it could
> definetely happen with some brute force or on another operating
> system.
The case that I can recall most clearly was actually in the other
direction: during system bootup, some NFS volume that was being abused
this way (mount point == data dir) was slow to mount. Compounding the
problem, postgres was being started through some init script that would
helpfully run initdb if it saw the specified data directory was empty.
So, rather than failing like a properly paranoid DBA would wish, it
ran initdb and then started the postmaster. A bit later, the NFS volume
came online, replacing the mount-point directory, and now the postmaster
had a devil's brew of open files on the local volume containing the mount
point and open files on the NFS volume. It didn't take long for that to
translate into hopeless catalog corruption. I don't think they ever got
their data back.
The true value of data-dir-at-least-one-level-down is so that it will
fail to be there at all if the file system isn't mounted. You need that,
and you do *not* want automated attempts to "repair" that.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, fluca1978@gmail.com, rjuju123@gmail.com
Subject: Re: why not using a mountpoint as PGDATA?
In-Reply-To: <14944.1551282132@sss.pgh.pa.us>
References: <CAKoxK+6H40imynM5P31bf0DnpN-5f5zeROjcaj6BKVAjxdEA9w@mail.gmail.com> <CAOBaU_aAp0gDP_ovqL2aDd_80bDHn805oL-dROxDCb9q4ySqxg@mail.gmail.com> <CAKoxK+57m-8pugYke+BYhYtPn4YYNJgzU8g21aMykEZmMdQgQw@mail.gmail.com> <14944.1551282132@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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