Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id ECF3C6329EC for ; Wed, 4 Aug 2010 09:55:35 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 81574-07 for ; Wed, 4 Aug 2010 12:55:28 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mh3.mail.rice.edu (mh3.mail.rice.edu [128.42.199.10]) by mail.postgresql.org (Postfix) with ESMTP id 380E46328B3 for ; Wed, 4 Aug 2010 09:55:27 -0300 (ADT) Received: from mh3.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh3.mail.rice.edu (Postfix) with ESMTP id 51B62324004; Wed, 4 Aug 2010 07:55:25 -0500 (CDT) X-Virus-Scanned: by amavis-2.6.0 at mh3.mail.rice.edu Received: from mh3.mail.rice.edu ([127.0.0.1]) by mh3.mail.rice.edu (mh3.mail.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jdINVEzeRgcv; Wed, 4 Aug 2010 07:55:25 -0500 (CDT) Received: from aart.is.rice.edu (aart.is.rice.edu [168.7.56.48]) by mh3.mail.rice.edu (Postfix) with ESMTP id 2BE1B324017; Wed, 4 Aug 2010 07:55:25 -0500 (CDT) Received: by aart.is.rice.edu (Postfix, from userid 18612) id AD1F62D5A6; Wed, 4 Aug 2010 07:55:24 -0500 (CDT) Date: Wed, 4 Aug 2010 07:55:24 -0500 From: Kenneth Marshall To: Frank Bax Cc: pgsql-sql@postgresql.org Subject: Re: What does PostgreSQL do when time goes backward? Message-ID: <20100804125524.GV12093@aart.is.rice.edu> References: <87eiegblzq.fsf@thumper.dhh.gt.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.16 (2007-06-09) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.21 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201008/14 X-Sequence-Number: 34454 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