mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-08-22 05:13:22 +02:00
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. |
||
---|---|---|
.. | ||
access | ||
bootstrap | ||
catalog | ||
commands | ||
datatype | ||
executor | ||
foreign | ||
lib | ||
libpq | ||
mb | ||
nodes | ||
optimizer | ||
parser | ||
port | ||
portability | ||
postmaster | ||
regex | ||
replication | ||
rewrite | ||
snowball | ||
storage | ||
tcop | ||
tsearch | ||
utils | ||
.gitignore | ||
c.h | ||
fmgr.h | ||
funcapi.h | ||
getaddrinfo.h | ||
getopt_long.h | ||
Makefile | ||
miscadmin.h | ||
pg_config_manual.h | ||
pg_config.h.in | ||
pg_config.h.win32 | ||
pg_trace.h | ||
pgstat.h | ||
pgtime.h | ||
port.h | ||
postgres_ext.h | ||
postgres_fe.h | ||
postgres.h | ||
rusagestub.h | ||
windowapi.h |