pg_autovacuum startup from /etc/rc fails after system crash

From: Jonathan Beit-Aharon <jbeitaharon(at)intrusic(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Jonathan Beit-Aharon <jbeitaharon(at)intrusic(dot)com>
Subject: pg_autovacuum startup from /etc/rc fails after system crash
Date: 2005-09-22 18:16:58
Message-ID: 4332F51A.4020800@intrusic.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#3333ff">
<font size="+1">Hi,<br>
I'm not a member of this list, so please CC me on responses and
discussion.<br>
<br>
After a system crash PostgreSQL startup is slow as the database </font><font
size="+1">recovers.&nbsp; So the db_connect() call from pg_autovacuum </font><font
size="+1">terminates</font><font size="+1"> as soon as it tries to
connect to "template1".<br>
<br>
Looking at the README file, I find this note:<br>
</font><font size="+1">&nbsp;&nbsp;&nbsp; pg_autovacuum does not get started
automatically by either the<br>
&nbsp;&nbsp;&nbsp; postmaster or by pg_ctl.&nbsp; Similarly, when the postmaster exits, no
one<br>
&nbsp;&nbsp;&nbsp; tells pg_autovacuum.&nbsp; The result of that is that at the start of the<br>
&nbsp;&nbsp;&nbsp; next loop, pg_autovacuum will fail to connect to the server and<br>
&nbsp;&nbsp;&nbsp; exit().&nbsp; Any time it fails to connect pg_autovacuum exit()s.<br>
<br>
So the failure we're experiencing is an unintended result of an
intended solution.&nbsp;&nbsp; Any suggestions on how I can work-around this
problem?<br>
<br>
Would it make sense to put the first db_connect() call in the
init_db_list() routine inside a [configurable repeatition] loop,
sleeping after disappointed attempt to connect, and breaking out on
success?&nbsp;&nbsp; That way, I think, when pg_autovacuum is initiated, we
assume the postmaster is up, but when the VacuumLoop connection fails,
we assume the postmaster went away, and take our exit().<br>
<br>
Thanks,<br>
Jonathan<br>
<br>
</font>
</body>
</html>

Attachment Content-Type Size
unknown_filename text/html 1.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Anthony Molinaro 2005-09-22 18:32:29 Re: Hierarchical Queries--Stalled No Longer...
Previous Message Josh Berkus 2005-09-22 18:01:41 Re: Hierarchical Queries--Stalled No Longer...