From: | Sean Chittenden <sean(at)chittenden(dot)org> |
---|---|
To: | "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Fast Shutdown (SIGINT) results in a CHECKPOINT... |
Date: | 2013-03-20 20:28:26 |
Message-ID: | DE6147ED-DD9C-47D8-8E1D-7236BB6362DE@chittenden.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
For a while now I've known that sending a SIGINT can trigger a CHECKPOINT, but I don't know if this is intentional or a bug. Logs from today:
> 2013-03-20_18:21:43.27642 LOG: received fast shutdown request
> 2013-03-20_18:21:43.27645 LOG: aborting any active transactions
> 2013-03-20_18:21:43.27647 FATAL: terminating connection due to administrator command
> 2013-03-20_18:22:14.25763 FATAL: the database system is shutting down
> 2013-03-20_18:22:14.26401 LOG: checkpoint starting: shutdown immediate
> 2013-03-20_18:25:36.98507 LOG: checkpoint complete: wrote 6403 buffers (2.3%); 0 transaction log file(s) added, 0 removed, 5 recycled; write=41.450 s, sync=156.157 s, total=202.943 s; sync files=50, longest=29.057 s, average=3.123 s
> 2013-03-20_18:25:37.65570 FATAL: the database system is shutting down
> 2013-03-20_18:25:37.71735 LOG: online backup mode canceled
And I believe this is where the db restarted:
> 2013-03-20_18:25:37.71739 DETAIL: "backup_label" was renamed to "backup_label.old".
> 2013-03-20_18:25:45.39001 LOG: loaded library "auto_explain"
> 2013-03-20_18:25:45.39647 LOG: loaded library "pg_stat_statements"
> 2013-03-20_18:26:04.67932 LOG: could not create socket for statistics collector: Protocol not supported
> 2013-03-20_18:26:04.67939 LOG: trying another address for the statistics collector
> 2013-03-20_18:26:05.01894 LOG: connection received: host=172.16.4.24 port=55414
> 2013-03-20_18:26:05.01903 FATAL: the database system is starting up
> 2013-03-20_18:26:05.41153 LOG: autovacuum launcher started
> 2013-03-20_18:26:05.41160 LOG: database system is ready to accept connections
Just shy of 5 minutes to do a fast shutdown/restart.
What I'm trying to determine is whether or not it's a bug for postmaster to CHECKPOINT during a fast shutdown or a documentation bug that a fast shutdown may cause a CHECKPOINT, which will delay the database being restarted.
I've run in to this before and in some scripts I run a CHECKPOINT before sending a SIGINT, which reduces the size of the CHECKPOINT, but doesn't necessarily eliminate it all of the time. In fact, I'm not sure it happens 100% of the time either, but today I was bit by this shutdown/startup delay and thought I'd inquire or submit a small doc patch. Thanks in advance. -sc
--
Sean Chittenden
sean(at)chittenden(dot)org
From | Date | Subject | |
---|---|---|---|
Next Message | David Rees | 2013-03-20 20:43:36 | Re: Can't terminate hung COPY |
Previous Message | Michael Orlitzky | 2013-03-20 20:24:02 | Re: State of the art re: group default privileges |