pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Multiple postmasters for one data directory...
3+ messages / 2 participants
[nested] [flat]

* Multiple postmasters for one data directory...
@ 2004-03-11 14:52  Stef <svb@ucs.co.za>
  0 siblings, 1 reply; 3+ messages in thread

From: Stef @ 2004-03-11 14:52 UTC (permalink / raw)
  To: pgsql-admin

Hi all,

I've got a situation on certain machines where approximately
70 postmasters are running. Each with one database, and one
data directory.

This is fine most of the time, except for a certain time of the month,
when a very large consolidation process has to run on each database.

At this time it is impossible to have all databases started with more shared
memory, and I basically lose the benefits of using a cluster that can make
use of much more memory at a time.

I've managed to make such a database cluster on a separate postmaster,
and re-linked all the database directories to point to the data directories
of all the other postmasters.

Although this workaround seems to be working rather well, I know for one
thing that it could be disastrous to have two postmasters running on the
same data directory at the same time, so I'll ensure that that doesn't happen.

Is what I'm doing VERY bad, and are there more things I'm overlooking?
Can this setup possibly break everything?

Kind Regards
Stefan

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Multiple postmasters for one data directory...
@ 2004-03-11 15:54  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Stef <svb@ucs.co.za>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2004-03-11 15:54 UTC (permalink / raw)
  To: Stef <svb@ucs.co.za>; +Cc: pgsql-admin

Stef <svb@ucs.co.za> writes:
> I've managed to make such a database cluster on a separate postmaster,
> and re-linked all the database directories to point to the data directories
> of all the other postmasters.

> Although this workaround seems to be working rather well, I know for one
> thing that it could be disastrous to have two postmasters running on the
> same data directory at the same time, so I'll ensure that that doesn't happen.

> Is what I'm doing VERY bad, and are there more things I'm overlooking?
> Can this setup possibly break everything?

I'm afraid you have already shot yourself in the foot.

The above cannot work because there is no way to share pg_xlog or
pg_clog across database clusters.  You have now got transaction numbers
from the "shared" postmaster inserted into the other databases, and when
you go back to separate postmasters you will have corruption.  I'm
surprised you do not already see inconsistencies, because if the
"shared" installation was a fresh one then it would probably see most of
the committed transaction numbers of the other databases as being "in
the future".

Get out your backup tapes, because what you have on disk now is just a
pile of inconsistent bits.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Multiple postmasters for one data directory...
@ 2004-03-12 07:47  Stef <svb@ucs.co.za>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Stef @ 2004-03-12 07:47 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-admin

Tom Lane mentioned :
=> Get out your backup tapes, because what you have on disk now is just a
=> pile of inconsistent bits.

I haven't actually done anything but SELECT's from the shared postmaster,
and it was a test machine. Phew!! Glad I asked first...

I think the way I'll do it, is by using initlocation, as this will solve all my problems,
except for having to reload all databases.

Thanks for the enlightening answer!

Kind Regards
Stefan

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2004-03-12 07:47 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-03-11 14:52 Multiple postmasters for one data directory... Stef <svb@ucs.co.za>
2004-03-11 15:54 ` Tom Lane <tgl@sss.pgh.pa.us>
2004-03-12 07:47   ` Stef <svb@ucs.co.za>

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