mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-27 08:39:28 +08:00
Unconditionally write the statsfile when SIGHUP is received, to minimize
the window during which backends have no statistics file to read.
This commit is contained in:
parent
d96d7be2b5
commit
f1e237b6b2
@ -1,4 +1,4 @@
|
|||||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.188 2008/08/25 15:11:00 mha Exp $ -->
|
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.189 2008/08/25 18:55:43 mha Exp $ -->
|
||||||
|
|
||||||
<chapter Id="runtime-config">
|
<chapter Id="runtime-config">
|
||||||
<title>Server Configuration</title>
|
<title>Server Configuration</title>
|
||||||
@ -3419,8 +3419,8 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
|
|||||||
<filename>pg_stat_tmp</filename>. Pointing this at a RAM based filesystem
|
<filename>pg_stat_tmp</filename>. Pointing this at a RAM based filesystem
|
||||||
will decrease physical I/O requirements and can lead to increased
|
will decrease physical I/O requirements and can lead to increased
|
||||||
performance. If this parameter is changed when the system is running,
|
performance. If this parameter is changed when the system is running,
|
||||||
the statistics functions might return no information until a new
|
there is a small window of time until the new file has been written
|
||||||
file has been written, which typically happens twice per second.
|
during which the statistics functions might return no information.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 2001-2008, PostgreSQL Global Development Group
|
* Copyright (c) 2001-2008, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.180 2008/08/25 15:11:00 mha Exp $
|
* $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.181 2008/08/25 18:55:43 mha Exp $
|
||||||
* ----------
|
* ----------
|
||||||
*/
|
*/
|
||||||
#include "postgres.h"
|
#include "postgres.h"
|
||||||
@ -2638,11 +2638,14 @@ PgstatCollectorMain(int argc, char *argv[])
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Reload configuration if we got SIGHUP from the postmaster.
|
* Reload configuration if we got SIGHUP from the postmaster.
|
||||||
|
* Also, signal a new write of the file, so we drop a new file as
|
||||||
|
* soon as possible of the directory for it changes.
|
||||||
*/
|
*/
|
||||||
if (got_SIGHUP)
|
if (got_SIGHUP)
|
||||||
{
|
{
|
||||||
ProcessConfigFile(PGC_SIGHUP);
|
ProcessConfigFile(PGC_SIGHUP);
|
||||||
got_SIGHUP = false;
|
got_SIGHUP = false;
|
||||||
|
need_statwrite = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user