Skip site navigation (1) Skip section navigation (2)

Re: Can Postgres 8.x start if some disks containing tablespaces are not mounted?

From: "Morris Goldstein" <morris(dot)x(dot)goldstein(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: Can Postgres 8.x start if some disks containing tablespaces are not mounted?
Date: 2008-04-01 14:12:15
Message-ID: 41b6f5c20804010712rb5f363nf3d26f83dfc92d53@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackers
On Mon, Mar 31, 2008 at 2:10 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> "Morris Goldstein" <morris(dot)x(dot)goldstein(at)gmail(dot)com> writes:
> > Suppose I have a database with $PGDATA on /dev/sda, and a tablespace
> > directory on /dev/sdb. Will Postgres start successfully if /dev/sda is
> > mounted and /dev/sdb is not? If not, why not?
>
> It will start, but you will have unpleasant failures when you try to use
> tables in the secondary tablespace

Understood. I can guarantee that there will be no such accesses until
/dev/sdb is mounted.

> ... note that if autovacuum is on,
> that is likely to happen even without any explicit action on your part.

That's a good point. We don't use autovacuum, and I guess we'd have to
forego it. (Or can it be turned on and off dynamically?)

But that makes me wonder: what about this sequence of events:

- Postgres running normally on /dev/sda and /dev/sdb.
- Update to table in /dev/sdb tablespace is committed but still exists in WAL.
- Postgres crashes (e.g. power failure).
- Postgres starts with /dev/sda only.
- Recovery needs to update table in /dev/sdb tablespace.

I assume bad things will happen in this case.

Jack

In response to

Responses

pgsql-hackers by date

Next:From: Michael PaesoldDate: 2008-04-01 14:21:34
Subject: Re: [HACKERS] How embarrassing: optimization of a one-shot query doesn't work
Previous:From: Tom LaneDate: 2008-04-01 14:06:01
Subject: Re: [HACKERS] How embarrassing: optimization of a one-shot query doesn't work

pgsql-general by date

Next:From: Tom LaneDate: 2008-04-01 14:22:03
Subject: Re: [HACKERS] ANALYZE getting dead tuple count hopelessly wrong
Previous:From: korryDate: 2008-04-01 14:11:30
Subject: Re: Role attribute for user email?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group