Re: What does PostgreSQL do when time goes backward?

From: Kenneth Marshall <ktm(at)rice(dot)edu>
To: Frank Bax <fbax(at)sympatico(dot)ca>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: What does PostgreSQL do when time goes backward?
Date: 2010-08-04 12:55:24
Message-ID: 20100804125524.GV12093@aart.is.rice.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Wed, Aug 04, 2010 at 07:20:31AM -0400, Frank Bax wrote:
> John Hasler wrote:
>> How does PostgreSQL react to time being stepped at bootup? My Chrony
>> NTP package might cause it to do so on rare occasions when the hardware
>> clock is way off. This would only happen during bootup.
>
>
> My ntp client changes clock (by small amount) at any time:
>
> Jul 25 05:29:38 bax ntpd[10269]: adjusting local clock by 0.098724s
> Jul 25 05:31:43 bax ntpd[10269]: adjusting local clock by 0.038991s
> Jul 25 06:13:38 bax ntpd[10269]: adjusting local clock by -0.037131s
> Jul 25 15:01:52 bax ntpd[10269]: adjusting local clock by -0.112429s
>

PostgreSQL does not use system time to track transactions so
you should be good. Also, these types of clock changes by ntpd
use the adjtime() system call which either slows or speeds the
system clock to make the adjustment over a period of time so
it should be minimally disruptive. These do seem to be larger
values than you might expect from a clock conditioned with ntpd.
Is it a VM or is there something going on that would stop or
suspend your system?

Cheers,
Ken

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Joshua Gooding 2010-08-04 14:22:12 Some quick questions
Previous Message A. Kretschmer 2010-08-04 11:48:08 Re: Help Need some hindsight