pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pgsql start implies initdb = bad

2009/11/25 Jan Danielsson <>:
> David Brownlee wrote:
> [---]
>> Just to clarify - the issue here is the psql data directory being on a
>> soft or interruptable nfs mount, a restart when the mount is down
>> causing initdb to run on the local filesystem, and then the mount
>> coming back and psql scribbling 'new db data' over the production
>> database?
> Â That's the core of the issue, yes. Information about "new" data gets
> read into memory. "Old" database appears where "new" database was when
> new mount completes. Database does confusing things to "Old" database
> because of partial "new" database information.

Thats what I thought - a particularly painful error mode that... :/

>> Running a database on an interruptable or soft mounted filesystem
>> manages to make using it on a normal nfs filesystem seem quite
>> sensible :)
> Â This is what happened: I noticed that template1 doesn't default to
> unicode, so I asked on a postgresql IRC channel if something has changed
> recently (since I had used utf-8 and template1 previously). After they
> asked a few questions I replied that initdb is automatically run as a
> part of "start" if no database has been initialized. Then came the,
> rather unexpected - I must admit, "ARE YOU FRIGGIN' INSANE?!", etc.
> Seeing as these guys have seen much more database experiences than have,
> and that they have more than one documented case were exactly what is
> done in default pkgsrc resulted in disaster, I thought I'd bring it up.
> I have done so. I leave it up to the people who know more about these
> things to determine if it's relevant. I'm not going to try to force the
> issue.

Its certainly an interesting case :)

The epic fail case is only going to be hit when someone has configured
their system in a hideously broken fashion anyway, but I can imagine
situations where people would prefer 'no database' to 'empty database'
when a system 'loses' its psql data dir, so certainly an option to the
rc.d file to disable the auto initdb (maybe by just setting something
in rc.conf) might be of interest.

Home | Main Index | Thread Index | Old Index