Re: Broken system timekeeping breaks the stats collector

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Broken system timekeeping breaks the stats collector
Date: 2012-06-17 10:48:30
Message-ID: CA+U5nM+TymD=rAy4Fkwfmp3xRdqpWykHFOpFhJXQsvsTJ_EQFw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 17 June 2012 08:26, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2012-06-17 10:54:10 Re: libpq compression
Previous Message Jeff Davis 2012-06-17 06:54:35 Re: [PATCH] Support for foreign keys with arrays