Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f1e237b

Browse files
committed
Unconditionally write the statsfile when SIGHUP is received, to minimize
the window during which backends have no statistics file to read.
1 parent d96d7be commit f1e237b

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

doc/src/sgml/config.sgml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.188 2008/08/25 15:11:00 mha Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.189 2008/08/25 18:55:43 mha Exp $ -->
22

33
<chapter Id="runtime-config">
44
<title>Server Configuration</title>
@@ -3419,8 +3419,8 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
34193419
<filename>pg_stat_tmp</filename>. Pointing this at a RAM based filesystem
34203420
will decrease physical I/O requirements and can lead to increased
34213421
performance. If this parameter is changed when the system is running,
3422-
the statistics functions might return no information until a new
3423-
file has been written, which typically happens twice per second.
3422+
there is a small window of time until the new file has been written
3423+
during which the statistics functions might return no information.
34243424
</para>
34253425
</listitem>
34263426
</varlistentry>

src/backend/postmaster/pgstat.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
* Copyright (c) 2001-2008, PostgreSQL Global Development Group
1515
*
16-
* $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.180 2008/08/25 15:11:00 mha Exp $
16+
* $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.181 2008/08/25 18:55:43 mha Exp $
1717
* ----------
1818
*/
1919
#include "postgres.h"
@@ -2638,11 +2638,14 @@ PgstatCollectorMain(int argc, char *argv[])
26382638

26392639
/*
26402640
* Reload configuration if we got SIGHUP from the postmaster.
2641+
* Also, signal a new write of the file, so we drop a new file as
2642+
* soon as possible of the directory for it changes.
26412643
*/
26422644
if (got_SIGHUP)
26432645
{
26442646
ProcessConfigFile(PGC_SIGHUP);
26452647
got_SIGHUP = false;
2648+
need_statwrite = true;
26462649
}
26472650

26482651
/*

0 commit comments

Comments
 (0)