Re: [HACKERS] Re: Reducing sema usage (was Postmaster dies with many child processes)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Re: Reducing sema usage (was Postmaster dies with many child processes)
Date: 1999-01-31 23:02:07
Message-ID: 8391.917823727@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Oliver Elphick" <olly(at)lfix(dot)co(dot)uk> writes:
> The major problem at the moment is not that a new backend fails, but
> that it brings down everything else with it.

Agreed.

> How about having a new backend set a one-byte flag in shared memory
> when it has finished setting itself up? as long as the flag is unset,
> the backend is still starting itself up, and a failure will not
> require other backends to be brought down.

Not much win to be had there, I suspect. The main problem is that as
soon as a new backend starts altering shared memory, you have potential
corruption issues to worry about if it goes down. And there's not
really very much the new backend can do before it alters shared memory.
In fact, it can't do much of *anything* until it's made an entry for
itself in the lock manager's PROC array, because it cannot find out
anything interesting without locking shared structures.

Hmm. If that's true, then the failure to get a sema would occur very
early in the new backend's lifetime, before it's had a chance to create
any trouble. Maybe the very easiest solution to the sema issue is to
make the new backend send a failure report to its client and then
exit(0) instead of exit(1), so that the postmaster considers it a clean
exit rather than a crash...

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Reinke 1999-02-01 00:22:03 Table exists, but not accessible?
Previous Message Oliver Elphick 1999-01-31 21:33:35 Re: [HACKERS] Re: Reducing sema usage (was Postmaster dies with many child processes)