postgresql/src/include
Tom Lane 9e18eacbdf Fix stats collector to recover nicely when system clock goes backwards.
Formerly, if the system clock went backwards, the stats collector would
fail to update the stats file any more until the clock reading again
exceeds whatever timestamp was last written into the stats file.  Such
glitches in the clock's behavior are not terribly unlikely on machines
not using NTP.  Such a scenario has been observed to cause regression test
failures in the buildfarm, and it could have bad effects on the behavior
of autovacuum, so it seems prudent to install some defenses.

We could directly detect the clock going backwards by adding
GetCurrentTimestamp calls in the stats collector's main loop, but that
would hurt performance on platforms where GetCurrentTimestamp is expensive.
To minimize the performance hit in normal cases, adopt a more complicated
scheme wherein backends check for clock skew when reading the stats file,
and if they see it, signal the stats collector by sending an extra stats
inquiry message.  The stats collector does an extra GetCurrentTimestamp
only when it receives an inquiry with an apparently out-of-order
timestamp.

To avoid unnecessary GetCurrentTimestamp calls, expand the inquiry messages
to carry the backend's current clock reading as well as its stats cutoff
time.  The latter, being intentionally slightly in-the-past, would trigger
more clock rechecks than we need if it were used for this purpose.

We might want to backpatch this change at some point, but let's let it
shake out in the buildfarm for awhile first.
2012-06-17 17:11:49 -04:00
..
access New SQL functons pg_backup_in_progress() and pg_backup_start_time() 2012-06-14 13:25:43 -04:00
bootstrap Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
catalog New SQL functons pg_backup_in_progress() and pg_backup_start_time() 2012-06-14 13:25:43 -04:00
commands Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
datatype Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
executor Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
foreign Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
lib Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
libpq Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
mb Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
nodes Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
optimizer Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
parser Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
port Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
portability Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
postmaster Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
regex Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
replication Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
rewrite Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
snowball Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
storage Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
tcop Restructure SELECT INTO's parsetree representation into CreateTableAsStmt. 2012-03-19 21:38:12 -04:00
tsearch Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
utils Improve reporting of permission errors for array types 2012-06-15 22:55:03 +03:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
c.h Remove leftovers of BeOS port 2012-05-14 04:50:39 +03:00
fmgr.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
funcapi.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
getaddrinfo.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
getopt_long.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
Makefile Fix server header file installation with vpath builds 2011-11-10 20:52:54 +02:00
miscadmin.h Do stack-depth checking in all postmaster children. 2012-04-08 19:07:55 +03:00
pg_config_manual.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
pg_config.h.in Put back AC_REQUIRE([AC_STRUCT_TM]). 2012-05-14 23:06:48 -04:00
pg_config.h.win32 Stamp HEAD as 9.3devel. 2012-06-13 20:03:02 -04:00
pg_trace.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
pgstat.h Fix stats collector to recover nicely when system clock goes backwards. 2012-06-17 17:11:49 -04:00
pgtime.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
port.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
postgres_ext.h Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
postgres_fe.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
postgres.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
rusagestub.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
windowapi.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00