Re: Broken system timekeeping breaks the stats collector - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Broken system timekeeping breaks the stats collector
Date
Msg-id CA+U5nM+TymD=rAy4Fkwfmp3xRdqpWykHFOpFhJXQsvsTJ_EQFw@mail.gmail.com
Whole thread Raw
In response to Broken system timekeeping breaks the stats collector  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Broken system timekeeping breaks the stats collector
List pgsql-hackers
On 17 June 2012 08:26, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> (1) In backend_read_statsfile, make an initial attempt to read the stats
> file and then read GetCurrentTimestamp after that.  If the local clock
> reading is less than the stats file's timestamp, we know that some sort
> of clock skew or glitch has happened, so force an inquiry message to be
> sent with the local timestamp.  But then accept the stats file anyway,
> since the skew might be small and harmless.  The reason for the forced
> inquiry message is to cause (2) to happen at the collector.

Fine, but please log this as a WARNING system time skew detected, so
we can actually see it has happened rather than just silently
accepting the situation.

It would be useful to document whether there are any other negative
effects from altering system time.

Perhaps we should do the same test at startup to see if the clock has
gone backwards then also. Perhaps we should also make note of any
major changes in time since last startup, which might help us detect
other forms of corruption.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: [PATCH] Support for foreign keys with arrays
Next
From: Magnus Hagander
Date:
Subject: Re: libpq compression