[tiny doc fix] statistics are not retained across immediate shutdown
[tiny doc fix] statistics are not retained across immediate shutdown
Hi, In the following page, statistics are kept across server restarts: http://www.postgresql.org/docs/current/static/monitoring-stats.html "When the server shuts down, a permanent copy of the statistics data is stored in the global subdirectory, so that statistics can be retained across server restarts." However, statistics are not retained after immediate shutdown (pg_ctl stop -mi). You may say "pg_ctl stop -mi is not a shutdown but an abort, so the sentence is not wrong", but it's an "immediate shutdown" and one mode of shutdown. I propose a tiny fix to clarify this. Please find the attached patch. I'd like this to be backported at least 9.2. Thanks. Regards, Takayuki Tsunakawa
Re: [tiny doc fix] statistics are not retained across immediate shutdown
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
"Tsunakawa, Takayuki" writes: > I propose a tiny fix to clarify this. Please find the attached patch. That's not an accurate description of what happens, though. AFAIR, we do not throw away pg_stats files as a result of recovery. regards, tom lane
Re: [tiny doc fix] statistics are not retained across immediate shutdown
От:
Andres Freund <andres@2ndquadrant.com>
Дата:
On 2013-09-04 10:53:19 -0400, Tom Lane wrote: > "Tsunakawa, Takayuki" writes: > > I propose a tiny fix to clarify this. Please find the attached patch. > > That's not an accurate description of what happens, though. > AFAIR, we do not throw away pg_stats files as a result of recovery. StartupXLOG() does a pgstat_reset_all() in the if (InRecovery) branch. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services
Re: [tiny doc fix] statistics are not retained across immediate shutdown
От:
Fujii Masao <masao.fujii@gmail.com>
Дата:
On Wed, Sep 4, 2013 at 11:56 PM, Andres Freund wrote: > On 2013-09-04 10:53:19 -0400, Tom Lane wrote: >> "Tsunakawa, Takayuki" writes: >> > I propose a tiny fix to clarify this. Please find the attached patch. >> >> That's not an accurate description of what happens, though. >> AFAIR, we do not throw away pg_stats files as a result of recovery. > > StartupXLOG() does a pgstat_reset_all() in the if (InRecovery) branch. Yes. And this causes one problem that the statistics data would be reset at the start after the clean shutdown of the standby server. Regards, -- Fujii Masao
Re: [tiny doc fix] statistics are not retained across immediate shutdown
От:
Bruce Momjian <bruce@momjian.us>
Дата:
Applied. --------------------------------------------------------------------------- On Wed, Sep 4, 2013 at 04:11:09AM +0000, Tsunakawa, Takayuki wrote: > Hi, > > In the following page, statistics are kept across server restarts: > > http://www.postgresql.org/docs/current/static/monitoring-stats.html > > "When the server shuts down, a permanent copy of the statistics data is stored in the global subdirectory, so that statistics can be retained across server restarts." > > > However, statistics are not retained after immediate shutdown (pg_ctl stop -mi). You may say "pg_ctl stop -mi is not a shutdown but an abort, so the sentence is not wrong", but it's an "immediate shutdown" and one mode of shutdown. > > I propose a tiny fix to clarify this. Please find the attached patch. > > I'd like this to be backported at least 9.2. Thanks. > > > Regards, Takayuki Tsunakawa > diff -rpcd a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml > *** a/doc/src/sgml/monitoring.sgml 2013-06-25 03:55:41.000000000 +0900 > --- b/doc/src/sgml/monitoring.sgml 2013-09-03 16:12:05.000000000 +0900 > *************** postgres: user</> *** 185,193 **** > pg_stat_tmp by default. > For better performance, stats_temp_directory</> can be > pointed at a RAM-based file system, decreasing physical I/O requirements. > ! When the server shuts down, a permanent copy of the statistics > data is stored in the global subdirectory, so that > ! statistics can be retained across server restarts. > > > > --- 185,195 ---- > pg_stat_tmp by default. > For better performance, stats_temp_directory</> can be > pointed at a RAM-based file system, decreasing physical I/O requirements. > ! When the server shuts down cleanly, a permanent copy of the statistics > data is stored in the global subdirectory, so that > ! statistics can be retained across server restarts. When recovery is > ! performed at server start (e.g. after immediate shutdown, server crash, > ! and point-in-time recovery), all statistics counters are reset. > > > > > -- > Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-hackers -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + Everyone has their own god. +