473,396 Members | 2,158 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

detecting a dead db not seeming to work

Hiya
I have now managed to get my code to function correctly for a none
present db, and one that is shutdown whilst it is being used. In both
cases my code functions and happily recovers on the db's return.

However one of the tests I performed was to kill -9 the postmaster
process to see how it would handle that (assuming the same behaviour).
However nothing happens! no segfault, no db connection failure etc.
Also what is weird is that even once I have removed the pid file from
/var/run I cannot restart postgres with the /etc/init.d/postgres
script! It claims postgres is running...

If I kill my daemon which is trying to talk to it, postgres starts
without problem agian!

it's as though my daemon trying to talk to it is keeping the connection
open and preventing the db from being started!

I am running postgres 7.3.4 under redhat 9.

Any idea whats going on? or suggestions?

Thanks

--
-----
Graeme Hinchliffe (BSc)
Core Internet Systems Designer
Zen Internet (http://www.zen.co.uk/)

Direct: 0845 058 9074
Main : 0845 058 9000
Fax : 0845 058 9005

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 23 '05 #1
3 1405
Graeme Hinchliffe <gr***************@zeninternet.co.uk> writes:
However one of the tests I performed was to kill -9 the postmaster
process to see how it would handle that (assuming the same behaviour).
However nothing happens! no segfault, no db connection failure etc.
That's the intended behavior on postmaster crash. It doesn't (and
shouldn't) affect existing backends.
If I kill my daemon which is trying to talk to it, postgres starts
without problem agian!
it's as though my daemon trying to talk to it is keeping the connection
open and preventing the db from being started!


A new postmaster can't start until the last old backend is gone. This
is a necessary interlock to avoid data corruption.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #2
On Thu, 2004-08-26 at 15:57, Tom Lane wrote:
Graeme Hinchliffe <gr***************@zeninternet.co.uk> writes:
However one of the tests I performed was to kill -9 the postmaster
process to see how it would handle that (assuming the same behaviour).
However nothing happens! no segfault, no db connection failure etc.


That's the intended behavior on postmaster crash. It doesn't (and
shouldn't) affect existing backends.


indeed, but I need to be able to see that it's dead so I can then try
and reconnect. What is the name of the process that will be holding the
connection open? by kill -9 ing the process I am trying to simulate a
failure case.
If I kill my daemon which is trying to talk to it, postgres starts
without problem agian!
it's as though my daemon trying to talk to it is keeping the connection
open and preventing the db from being started!


A new postmaster can't start until the last old backend is gone. This
is a necessary interlock to avoid data corruption.


But I kill -9 the postmaster, and I cannot start a fresh one, so my
process is sat in limbo, thinking it is talking to a db that isn't there
:).

Well I think so, although I suspect that some part of the db is still
there and running?

--
-----
Graeme Hinchliffe (BSc)
Core Internet Systems Designer
Zen Internet (http://www.zen.co.uk/)

Direct: 0845 058 9074
Main : 0845 058 9000
Fax : 0845 058 9005

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #3
Graeme Hinchliffe <gr***************@zeninternet.co.uk> writes:
On Thu, 2004-08-26 at 15:57, Tom Lane wrote:
A new postmaster can't start until the last old backend is gone. This
is a necessary interlock to avoid data corruption.
But I kill -9 the postmaster, and I cannot start a fresh one, so my
process is sat in limbo, thinking it is talking to a db that isn't there
:). Well I think so, although I suspect that some part of the db is still
there and running?


Certainly --- the backend that's serving your connection. See
http://www.postgresql.org/docs/7.4/s...ect-estab.html

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Brian | last post by:
On a Slackware 9.1 box, I'm trying to detect if mpg123 is currently running/playing a song so that when the song is done, it'll play the next in the list. The problem is that popen'ing ps doesn't...
9
by: D. Shane Fowlkes | last post by:
I'm using SQL Server 2000 and on my page, I'm simply creating a SQLDataReader and filling in Labels with the retrieved (single) record. However, how can I prevent from getting errors when a field...
3
by: John Veldthuis | last post by:
Are there any tools for detecting un-used variables in VS VB 2003? I have been hacking my old VB6 code into VB2003 and there may be stuff left over I no longer need.used but may be still there....
25
by: junky_fellow | last post by:
Is there any way by which the overflow during addition of two integers may be detected ? eg. suppose we have three unsigned integers, a ,b, c. we are doing a check like if ((a +b) > c) do...
19
by: Lyle Fairfield | last post by:
MSDN Home > MSDN Library > Win32 and COM Development Data Access Microsoft offers many data access technologies to suit various development needs. This section of the MSDN Library contains...
79
by: VK | last post by:
I wandering about the common proctice of some UA's producers to spoof the UA string to pretend to be another browser (most often IE). Shouldn't it be considered as a trademark violation of the...
15
by: =?Utf-8?B?U2ltb24=?= | last post by:
Hi I am trying to read the html header 'if modified since' by using Request.ServerVariables("HTTP_IF_MODIFIED_SINCE") in classic ASP. But I am unable to get anything from this, this variable is...
15
by: RobG | last post by:
When using createEvent, an eventType parameter must be provided as an argument. This can be one of those specified in DOM 2 or 3 Events, or it might be a proprietary eventType. My problem is...
44
by: Pilcrow | last post by:
Is there a way that a proram can detect whether it is operating in an ASCII or an EBCDIC environment?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.