473,811 Members | 3,314 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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*******@postg resql.org

Nov 23 '05 #1
3 1430
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
3254
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 always give a correct return. My function is below and I added a second check that runs 1 second later which sometimes works, sometimes doesn't. Here's my function: def pid_defunct(): #1 = defunct processes
9
2022
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 is null? I've tried something like this (experimenting with IsDBNull): ========================================================= If dtrData.IsDBNull("Address2") = True Then lblAddress2.Text = "" Else
3
1444
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. It is quite large so would take some time to do this manually.
25
6282
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 something;
19
3139
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 technical information about current data access technologies, focusing on the Microsoft Data Access Components (MDAC): ADO, OLE DB and OLE DB Providers, and ODBC. Articles on ADO.NET, Microsoft Data Engine (MSDE), and some XML for Analysis (XMLA)...
79
3806
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 relevant name owner? If I make a whisky and call it "Jack Daniels", I most probably will have some serious legal problems. "Mozilla" partially appeared because NCSA stopped them from using "Mosaic" in the UA string. Is it some different...
15
4026
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 always empty. It is also excluded when I try to list all the server variables. We are using IIS6. So please can someone confirm what is the correct syntax? Cheers,
15
4236
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 testing for support of particular eventTypes - the DOM 2 Events Interface DocumentEvent says that if the eventType is not supported, it throws a DOM exception. This makes testing rather tough - if you try something like: if (document &&...
44
3869
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
9731
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9605
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10651
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10405
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9208
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7671
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5556
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5697
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3871
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.