Bug 587735 - postgres-8.sh will fail to stop gracefully if there is active clients connected
Summary: postgres-8.sh will fail to stop gracefully if there is active clients connected
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: rgmanager
Version: 5.3
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Marek Grac
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks: 612165
TreeView+ depends on / blocked
 
Reported: 2010-04-30 18:20 UTC by Shane Bradley
Modified: 2018-11-14 18:52 UTC (History)
7 users (show)

Fixed In Version: rgmanager-2.0.52-6.11.el5
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 612165 (view as bug list)
Environment:
Last Closed: 2011-01-13 23:25:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch to send SIGQUIT to disconnect the clients (639 bytes, application/octet-stream)
2010-04-30 18:20 UTC, Shane Bradley
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0134 0 normal SHIPPED_LIVE rgmanager bug fix and enhancement update 2011-01-12 19:20:47 UTC

Description Shane Bradley 2010-04-30 18:20:08 UTC
Created attachment 410562 [details]
Patch to send SIGQUIT to disconnect the clients

Description of problem:

It there is active connections to the postgres database then a SIGTERM
will fail thus the resource will fail to stop. This can result in the
service/resource for failing over. A solution to this is send a
SIGQUIT if the SIGTERM fails. Below is documentation on postgres.

Postgres documentation on stopping the pid:
To terminate the postgres server normally, the signals SIGTERM,
SIGINT, or SIGQUIT can be used. The first will wait for all clients to
terminate before quitting, the second will forcefully disconnect all
clients, and the third will quit immediately without proper shutdown,
resulting in a recovery run during restart.

Sample error message that is created:
Apr 28 13:23:46 rh5node-single clurgmgrd[3094]: <notice> Stopping service service:psql 
Apr 28 13:23:47 rh5node-single clurgmgrd: [3094]: <debug> Verifying Configuration Of postgres-8:postgresql 
Apr 28 13:23:47 rh5node-single clurgmgrd: [3094]: <debug> Verifying Configuration Of postgres-8:postgresql > Succeed 
Apr 28 13:23:47 rh5node-single clurgmgrd: [3094]: <info> Stopping Service postgres-8:postgresql 
Apr 28 13:24:49 rh5node-single clurgmgrd: [3094]: <err> Stopping Service postgres-8:postgresql > Failed - Application Is Still Running 
Apr 28 13:24:49 rh5node-single clurgmgrd: [3094]: <err> Stopping Service postgres-8:postgresql > Failed 
Apr 28 13:24:49 rh5node-single clurgmgrd[3094]: <notice> stop on postgres-8 "postgresql" returned 1 (generic error) 
Apr 28 13:24:49 rh5node-single clurgmgrd: [3094]: <info> Removing IPv4 address 192.168.1.56/24 from eth1 
Apr 28 13:24:59 rh5node-single clurgmgrd[3094]: <crit> #12: RG service:psql failed to stop; intervention required 
Apr 28 13:24:59 rh5node-single clurgmgrd[3094]: <notice> Service service:psql is failed 

Version-Release number of selected component (if applicable):
rgmanager-2.0.52-6.el5

How reproducible:
Everytime

Steps to Reproduce:
1. Start up a postgres-8.sh resource contained in a service
2. Open an active connection to the database
3. Stop the postgres-8.sh resource contained in a service
  
Actual results:

The postgres-8.sh resource will fail to stop gracefully this can lead
to a service not failing over correctly.

Expected results:
The postgres-8.sh service gracefully stop and allow failover to occur.

Additional info:

Patch is attached to fix issue by sending SIGQUIT to postgres pid if
the SIGTERM kill fails.

Comment 2 Ricardo Arguello 2010-07-02 20:03:11 UTC
I was having the same problem and tried your patch. I can confirm it works, thanks.

Comment 3 Marek Grac 2010-07-16 11:40:40 UTC
Hi,

Shane thanks for a patch, I have created a new one which is very similar but implements it in a way that other resource agents can use this functionality too. Patch is available in upstream now:

http://git.fedorahosted.org/git/?p=cluster.git;a=commit;h=87863e2c83b8cc3f6d7cb6b657202e04bd2df40f

Comment 8 errata-xmlrpc 2011-01-13 23:25:43 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0134.html


Note You need to log in before you can comment on or make changes to this bug.