Re: How to shoot yourself in the foot: kill -9 postmaster - Mailing list pgsql-hackers

From Tom Lane
Subject Re: How to shoot yourself in the foot: kill -9 postmaster
Date
Msg-id 7350.983910059@sss.pgh.pa.us
Whole thread Raw
In response to Re: How to shoot yourself in the foot: kill -9 postmaster  (Alfred Perlstein <bright@wintelcom.net>)
List pgsql-hackers
Alfred Perlstein <bright@wintelcom.net> writes:
> Of course not, the size of the struct changed (short->unsigned
> long, basically int16_t -> uint32_t), because the kernel and userland
> in Linux are hardly in sync you have the fun of guessing if you
> get:

> old struct -> old syscall (ok)
> new struct -> old syscall (boom)
> old struct -> new syscall (boom)
> new struct -> new syscall (ok)

Ugh.  However, it looks like it might be fairly fail-soft: if we
have the wrong declaration then we pick up some other field of the
struct, and probably end up complaining because nattch appears nonzero.
Recovery method (clean up the shm seg or delete lockfile) is the same.

I'm still inclined to go with this; it beats corrupting the WAL log,
and the fcntl(SETLK) alternative has its own set of portability
booby-traps.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Alfred Perlstein
Date:
Subject: Re: How to shoot yourself in the foot: kill -9 postmaster
Next
From: Peter Eisentraut
Date:
Subject: Re: epoch