Re: [GENERAL] Restart after poweroutage

2007-07-02 Thread Jon Lapham
Tom Lane wrote: Some time ago, Jon Lapham <[EMAIL PROTECTED]> wrote: Today I had a power outage which upon reboot seems to have done something to cause Postgresql to not restart properly. This has happened to me before: http://archives.postgresql.org/pgsql-general/2006-09/msg00938.php We fi

Re: [GENERAL] Restart after poweroutage

2007-07-02 Thread Tom Lane
Some time ago, Jon Lapham <[EMAIL PROTECTED]> wrote: > Today I had a power outage which upon reboot seems to have done > something to cause Postgresql to not restart properly. This has > happened to me before: > http://archives.postgresql.org/pgsql-general/2006-09/msg00938.php We finally tracke

Re: [GENERAL] Restart after poweroutage

2007-03-13 Thread Jon Lapham
Tom Lane wrote: BTW, you said you were on FC6, but what kernel version exactly? (uname -a is good) [EMAIL PROTECTED] > uname -a Linux bilbo.localdomain 2.6.19-1.2911.6.5.fc6 #1 SMP Sun Mar 4 16:05:34 EST 2007 x86_64 x86_64 x86_64 GNU/Linux [EMAIL PROTECTED] > cat /proc/cpuinfo processor

Re: [GENERAL] Restart after poweroutage

2007-03-13 Thread Tom Lane
BTW, you said you were on FC6, but what kernel version exactly? (uname -a is good) regards, tom lane ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if

Re: [GENERAL] Restart after poweroutage

2007-03-13 Thread Tom Lane
Jon Lapham <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Just for completeness, could we see the output of "ipcs -a" now? > [EMAIL PROTECTED] ~]# ipcs -a Thanks. The postgres segment looks pretty standard here. I'm a bit curious what all the lapham-owned destroyed segments are --- any idea? A

Re: [GENERAL] Restart after poweroutage

2007-03-13 Thread Jon Lapham
Tom Lane wrote: Jon Lapham <[EMAIL PROTECTED]> writes: Tom Lane wrote: It would seem that maybe your kernel has a different idea of what EIDRM means than we do. You say this persists across a reboot? I probably should have asked before doing this... but I just rebooted and postgresql came u

Re: [GENERAL] Restart after poweroutage

2007-03-13 Thread Tom Lane
Jon Lapham <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> It would seem that maybe your kernel has a different idea of what EIDRM >> means than we do. You say this persists across a reboot? > I probably should have asked before doing this... but I just rebooted > and postgresql came up fine.

Re: [GENERAL] Restart after poweroutage

2007-03-13 Thread Jon Lapham
Tom Lane wrote: Oh, that's interesting. The code is barfing on this because /* * Otherwise, we had better assume that the segment is in use. The * only likely case is EIDRM, which implies that the segment has been * IPC_RMID'd but there are still processes att

Re: [GENERAL] Restart after poweroutage

2007-03-13 Thread Tom Lane
Jon Lapham <[EMAIL PROTECTED]> writes: > chdir("/var/lib/pgsql/data")= 0 > open("postmaster.pid", O_RDWR|O_CREAT|O_EXCL, 0600) = -1 EEXIST (File > exists) > open("postmaster.pid", O_RDONLY)= 3 > read(3, "2809\n/var/lib/pgsql/data\n 54320"..., 1123) = 45 > close(3)

Re: [GENERAL] Restart after poweroutage

2007-03-13 Thread Jon Lapham
Tom Lane wrote: Jon Lapham <[EMAIL PROTECTED]> writes: Tom Lane wrote: Let's see the output from sudo ipcs -a [EMAIL PROTECTED] ~]# ipcs -a [ no postgres-owned segments... ] Well, that's dang interesting. Could you run the postmaster under strace and send the output? Let me know if thi

Re: [GENERAL] Restart after poweroutage

2007-03-13 Thread Tom Lane
Jon Lapham <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Let's see the output from >> sudo ipcs -a > [EMAIL PROTECTED] ~]# ipcs -a [ no postgres-owned segments... ] Well, that's dang interesting. Could you run the postmaster under strace and send the output? regards,

Re: [GENERAL] Restart after poweroutage

2007-03-13 Thread Jon Lapham
Tom Lane wrote: Jon Lapham <[EMAIL PROTECTED]> writes: What can I do to help diagnose what is happening? Let's see the output from ps auxww | grep postgres sudo ipcs -a [EMAIL PROTECTED] ~]# ps auxww | grep postgres root 3969 0.0 0.0 60272 688 pts/1R+ 15:47 0:00 grep postg

Re: [GENERAL] Restart after poweroutage

2007-03-13 Thread Tom Lane
Jon Lapham <[EMAIL PROTECTED]> writes: > What can I do to help diagnose what is happening? Let's see the output from ps auxww | grep postgres sudo ipcs -a (or local equivalents) regards, tom lane ---(end of broadcast)--- TI

[GENERAL] Restart after poweroutage

2007-03-13 Thread Jon Lapham
Today I had a power outage which upon reboot seems to have done something to cause Postgresql to not restart properly. This has happened to me before: http://archives.postgresql.org/pgsql-general/2006-09/msg00938.php ...and during this previous discussion, Tom Lane pointed out that I may have

Re: [GENERAL] Restart after poweroutage

2006-09-26 Thread MaXX
Tom Lane wrote: Jon Lapham <[EMAIL PROTECTED]> writes: [...] -- Shared Memory Segments keyshmid owner perms bytes nattch status 0x 0 root 77794208 0 0x6a6b6cbd 53411843 lapham6003840 0x12ac1925

Re: [GENERAL] Restart after poweroutage

2006-09-26 Thread Tom Lane
Jon Lapham <[EMAIL PROTECTED]> writes: > Is it important for you to know that at the time of the power outage, I > *did* have 2 closed source kernel modules loaded, vmware's and NVidia's. > (This is a development machine, not production...). Could one of > these modules screwed up somehow and

Re: [GENERAL] Restart after poweroutage

2006-09-26 Thread Jon Lapham
Tom Lane wrote: Jon Lapham <[EMAIL PROTECTED]> writes: To stress test, I turned off the power while actively processing db operations, such as: loading data into a database, create a new database, delete contents of a large table within a transaction. Anyway, in every case I could not reproduce

Re: [GENERAL] Restart after poweroutage

2006-09-26 Thread Jon Lapham
Harald Armin Massa wrote: It is inherently flawed. VMware really "powers down", that is, the operating system has time to shut down. Or, in other incarnations, VMware freezes the system state. It's nothing near a real power outage, which gives no time for anything. On my VMware window, there

Re: [GENERAL] Restart after poweroutage

2006-09-26 Thread Jon Lapham
Tom Lane wrote: Jon Lapham <[EMAIL PROTECTED]> writes: Is it important for you to know that at the time of the power outage, I *did* have 2 closed source kernel modules loaded, vmware's and NVidia's. (This is a development machine, not production...). Could one of these modules screwed up s

Re: [GENERAL] Restart after poweroutage

2006-09-26 Thread Tom Lane
Jon Lapham <[EMAIL PROTECTED]> writes: > To stress test, I turned off the power while actively processing db > operations, such as: loading data into a database, create a new > database, delete contents of a large table within a transaction. > Anyway, in every case I could not reproduce the issue

Re: [GENERAL] Restart after poweroutage

2006-09-26 Thread Harald Armin Massa
Jon,For what it is worth, I created a FC5 VMware installation and loaded mydatabase data into it.  I simulated a bunch of power outages by telling VMware to power off the vm.  Is this a good simulation of a poweroutage, or is there something inherently flawed about using a VM to testthis?It is inhe

Re: [GENERAL] Restart after poweroutage

2006-09-26 Thread Jon Lapham
Tom Lane wrote: Adrian Klaver <[EMAIL PROTECTED]> writes: On Sunday 24 September 2006 09:17 am, Tom Lane wrote: Jon Lapham <[EMAIL PROTECTED]> writes: FATAL: pre-existing shared memory block (key 5432001, ID 65536) is still in use This is extremely odd, because a shared memory block could no

Re: [GENERAL] Restart after poweroutage

2006-09-25 Thread Tom Lane
I wrote: > Also, if it is repeatable, "ipcs -m" output will be useful context. I forgot to mention: on Linux it's important to run ipcs as root (eg "sudo ipcs -m") else it will lie to you. An incomplete listing is worse than useless. regards, tom lane ---

Re: [GENERAL] Restart after poweroutage

2006-09-25 Thread Tom Lane
Adrian Klaver <[EMAIL PROTECTED]> writes: > On Monday 25 September 2006 02:48 pm, Tom Lane wrote: >> I spent quite some time today trying to duplicate this failure (by >> pulling the plug on an up-to-date Fedora Core 5 machine). No luck. > Is there something I could do to help capture useful info

Re: [GENERAL] Restart after poweroutage

2006-09-25 Thread Adrian Klaver
On Monday 25 September 2006 02:48 pm, Tom Lane wrote: > Adrian Klaver <[EMAIL PROTECTED]> writes: > > On Sunday 24 September 2006 09:17 am, Tom Lane wrote: > >> Jon Lapham <[EMAIL PROTECTED]> writes: > >>> FATAL: pre-existing shared memory block (key 5432001, ID 65536) is > >>> still in use > >> >

Re: [GENERAL] Restart after poweroutage

2006-09-25 Thread Tom Lane
Adrian Klaver <[EMAIL PROTECTED]> writes: > On Sunday 24 September 2006 09:17 am, Tom Lane wrote: >> Jon Lapham <[EMAIL PROTECTED]> writes: >>> FATAL: pre-existing shared memory block (key 5432001, ID 65536) is >>> still in use >> >> This is extremely odd, because a shared memory block could not

Re: [GENERAL] Restart after poweroutage

2006-09-24 Thread Alvaro Herrera
Jon Lapham wrote: > [EMAIL PROTECTED] ~]# ps -A | grep -i post > 30760 ?00:00:00 postmaster > 30762 ?00:00:00 postmaster > 30764 ?00:00:00 postmaster > 30765 ?00:00:00 postmaster > 30766 ?00:00:00 postmaster > > ...is that normal to see 5 of them running?

Re: [GENERAL] Restart after poweroutage

2006-09-24 Thread Adrian Klaver
On Sunday 24 September 2006 09:17 am, Tom Lane wrote: > Jon Lapham <[EMAIL PROTECTED]> writes: > > I recently had another electrical power outage that left my machine > > unable to restart postgresql. I had previously reported this a while > > ago: > > > > http://archives.postgresql.org/pgsql-gene

Re: [GENERAL] Restart after poweroutage

2006-09-24 Thread MaXX
Jon Lapham wrote: [...] I do not *think* I am running 2 postmasters. [EMAIL PROTECTED] ~]# service postgresql stop Stopping postgresql service: [ OK ] [EMAIL PROTECTED] ~]# ps -A | grep -i post [EMAIL PROTECTED] ~]# service postgresql start Starting postgresql se

Re: [GENERAL] Restart after poweroutage

2006-09-24 Thread Jon Lapham
Tom Lane wrote: Jon Lapham <[EMAIL PROTECTED]> writes: I recently had another electrical power outage that left my machine unable to restart postgresql. I had previously reported this a while ago: http://archives.postgresql.org/pgsql-general/2005-04/msg01286.php Anyway, because I have seen

Re: [GENERAL] Restart after poweroutage

2006-09-24 Thread Joshua D. Drake
This doesn't make sense to me. A reboot will absolutly kill any existing shared memory blocks, how can it possibly be complaining about it? PostgreSQL complains if it finds a postmaster.pid. As far as I can tell it doesn't have anything to do with shared memory except that we are tracking in

Re: [GENERAL] Restart after poweroutage

2006-09-24 Thread Tom Lane
Jon Lapham <[EMAIL PROTECTED]> writes: > I recently had another electrical power outage that left my machine > unable to restart postgresql. I had previously reported this a while ago: > http://archives.postgresql.org/pgsql-general/2005-04/msg01286.php > Anyway, because I have seen this problem

Re: [GENERAL] Restart after poweroutage

2006-09-24 Thread Martijn van Oosterhout
On Sun, Sep 24, 2006 at 10:11:00AM -0300, Jon Lapham wrote: > I recently had another electrical power outage that left my machine > unable to restart postgresql. I had previously reported this a while ago: FWIW, I've crashed my machine a lot of times and never run into this problem. However, I r

Re: [GENERAL] Restart after poweroutage

2006-09-24 Thread Richard Broersma Jr
> ...but for > yucks I decided to imagine I did not know. What would I need to do to > figure this out. > Maybe it is just a right > of passage that users of postgresql will just have to learn about this. I would imagine that I am one of the yucks like you. ;-) Anyway, everytime I see a us

[GENERAL] Restart after poweroutage

2006-09-24 Thread Jon Lapham
I recently had another electrical power outage that left my machine unable to restart postgresql. I had previously reported this a while ago: http://archives.postgresql.org/pgsql-general/2005-04/msg01286.php Anyway, because I have seen this problem before, I knew exactly what the solution to