Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gWtyo-0001Tc-3t for pgsql-bugs@arkaria.postgresql.org; Wed, 12 Dec 2018 02:10:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gWtym-0000qa-IA for pgsql-bugs@arkaria.postgresql.org; Wed, 12 Dec 2018 02:10:28 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gWtRY-0006hN-Nz for pgsql-bugs@lists.postgresql.org; Wed, 12 Dec 2018 01:36:09 +0000 Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gWtRV-0007UZ-JY for pgsql-bugs@lists.postgresql.org; Wed, 12 Dec 2018 01:36:07 +0000 Received: by mail-io1-xd2c.google.com with SMTP id l3so2292736ioc.10 for ; Tue, 11 Dec 2018 17:36:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=Qst2RQRW3bkdW8ohnAc8N6AGtlovQKNXJadiA0O5mU4=; b=YNqoJhZ0ooWSPp+VVBwryFNMCvHTLe4wd+7jFBtfwniCPPOZ/urHAcuk4DUyVPy6uZ vHliB+LEJHOmZq923+esgu4FpXe/lSxLdTCc9Ykvg4l2a9gn/PpWWEGaDv/FcD3SXEG7 65T+ubE739bzn57nyV5GG9BafrtZ8SuQJNm+1MR/yXtT7cp122QTkuR/uNyIMxHx3y0Q nRcrX3jauzbNCVixZih7HrG0HAm7z5zH/3XdddwELJtiHwgEIJ3pSZ5cA6vqnSNx8/CF zW72kc8hihazmsMSZYfR8MKTN2vdz7TWhFqq7fWlWmtG1HMUr97the+R7xrk+RJveNyt EDMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=Qst2RQRW3bkdW8ohnAc8N6AGtlovQKNXJadiA0O5mU4=; b=Xutx2dofT9gpekqCDd3Q3pRrC2LghylQqrkoXeMpVHwG47Lq9jA/5+SZPy8WtPLAPY ECAglhWpk1Uz38w5VOwra8tkF5R0z10qr0EMwvdyFYJnIp+DqtoFHF4CUMfgVbtuuTMG I0Nm+OgXfyEKCNjXue4n52rKZmMbczStnBGYEPYqHGysCU/y2BdVsMLUPjvC4MzXKmTN ClyE2/OAm7YpCXuWnvs/sOzPkjUOMxW/5Qq85lStP3cYWbvL4ZyjXNajLCc3cqYLVc/9 ua+5bd4SiXKpsXXTROJA2T6oaNhvOkDfSyTa+4yHk8oOUtbvazGaj1SLdPVbSo+Bs0b+ gGzg== X-Gm-Message-State: AA+aEWb3wYI3l/5sZ+6+2J8Lp6OHTNkUulSNUe6exf3mgkofnQd3Y9j8 3xmoYl0jfapOgl9Gf0VxwBF9sUFvW1EMzR4+CQfyMw== X-Google-Smtp-Source: AFSGD/XJc7T2L7hgRYd/tQkLZwLXIJEK1DK5JnF5d/dTvjDqdfIeCKp4faKh12LMel9qkYE7enr2NE1gMLFiSi1twow= X-Received: by 2002:a5d:870c:: with SMTP id u12mr15205794iom.168.1544578564313; Tue, 11 Dec 2018 17:36:04 -0800 (PST) MIME-Version: 1.0 References: <15547-078cffc281899f40@postgresql.org> <28850.1544575604@sss.pgh.pa.us> In-Reply-To: From: Matteo Date: Tue, 11 Dec 2018 17:35:55 -0800 Message-ID: Subject: Fwd: BUG #15547: default timezone on servers running while time changed from PDT to PST reverting to UTC. To: pgsql-bugs@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000a7598f057cc938f7" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --000000000000a7598f057cc938f7 Content-Type: text/plain; charset="UTF-8" Thanks for the quick response. I thought the same thing about tzdata but I didn't update that on any servers in that timeframe, the servers are only updated manually and the only package that I added was "psmisc-22.20-15.el7.x86_64" on Nov 14th. Additionally, the service postgresql has been reloaded several times (but never restarted), I even tried reloading now and keeps its "bug". I did notice, skimming through the source, that when loading the timezone there's a check to make sure the timezone selected "makes sense" otherwise defaults to UTC, but what throws me off is that querying the database still returns my original 'timezone' and not 'utc'. Some more info: this is the PS situation on that server: postgres 5236 0.0 0.2 342980 4852 ? S Oct23 20:02 /usr/bin/postgres -D /var/lib/pgsql/data postgres 5288 0.0 0.0 195440 1004 ? Ss Oct23 0:00 \_ postgres: logger process postgres 5298 0.0 0.8 343388 15256 ? Ss Oct23 0:53 \_ postgres: checkpointer process postgres 5299 0.0 0.1 342980 2008 ? Ss Oct23 0:25 \_ postgres: writer process postgres 5300 0.0 0.2 342980 5212 ? Ss Oct23 1:36 \_ postgres: wal writer process postgres 5301 0.0 0.0 343504 1708 ? Ss Oct23 1:20 \_ postgres: autovacuum launcher process postgres 5302 0.0 0.0 195828 1356 ? Ss Oct23 9:22 \_ postgres: stats collector process postgres 17078 0.0 0.1 344052 2224 ? Ss Oct23 0:00 \_ postgres: postgres dbbase [local] idle postgres 31257 0.0 0.0 343808 1304 ? Ss Dec05 0:00 \_ postgres: postgres dbbase 127.0.0.1(39728) idle postgres 31258 0.0 0.0 343808 1300 ? Ss Dec05 0:00 \_ postgres: postgres dbbase 127.0.0.1(39732) idle postgres 19698 0.3 0.7 347208 14360 ? Ss Dec07 18:51 \_ postgres: postgres dbbase [local] idle postgres 10441 0.0 0.2 344052 5580 ? Ss 17:13 0:00 \_ postgres: postgres dbbase [local] idle and netstat # netstat -antup | grep 5432 tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 5236/postgres tcp 0 0 127.0.0.1:5432 127.0.0.1:39732 ESTABLISHED 31258/postgres: pos tcp 0 0 127.0.0.1:5432 127.0.0.1:39728 ESTABLISHED 31257/postgres: pos tcp 0 0 127.0.0.1:39732 127.0.0.1:5432 ESTABLISHED 31253/sm tcp 0 0 127.0.0.1:39728 127.0.0.1:5432 ESTABLISHED 31251/c2s tcp6 0 0 ::1:5432 :::* LISTEN 5236/postgres So far I've tried faking time with both changing the time manually and using ntp, but no matter what, the processes catch up to the real time, so it's not a good test... and now I have placed a server in a closed environment and made it believe it's Oct. 31st, turned off ntp, and I'll keep observing. If you guys can think of any additional logging/test I could turn on/launch over there to make sure I track this possible behavior, that'd be cool Thank you :) On Tue, Dec 11, 2018 at 4:46 PM Tom Lane wrote: > =?utf-8?q?PG_Bug_reporting_form?= writes: > > I have a bunch of servers that never restarted in the past couple of > months > > and had postgres running since before Nov. 4th and I discovered that > their > > default timezone changed in the background. > > Hmph. Ordinarily I'd expect that the default zone data would be cached > in the postmaster and inherited via fork() by backends, so that as long > as you didn't do something like change the timezone setting in > postgresql.conf, the behavior would be stable until postmaster restart. > (People who live in zones with frequent DST law changes have complained > of that ... but I'm not very much in a hurry to change it.) > > So it's not at all clear what happened here. I think that Red Hat did > push out a tzdata update in early November, but even so, the behavior > of America/Los_Angeles shouldn't have changed. *Maybe* this could > be explained by having restarted those postmasters during the tiny > interval where the package update was happening and there wasn't anything > valid for /etc/localtime to point at --- but that stretches credulity. > > If you can figure out a way to reproduce this, we'd be interested to > hear what it is. > > regards, tom lane > --000000000000a7598f057cc938f7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks for the quick response.

I thought the same thing about tzdata but I didn'= ;t update that on any servers in that timeframe, the servers are only updat= ed manually and the only package that I added was "psmisc-22.20-15.el7= .x86_64" on Nov 14th.

Additionally, the servi= ce postgresql has been reloaded several times (but never restarted), I even= tried reloading now and keeps its "bug".
I did notice,= skimming through the source, that when loading the timezone there's a = check to make sure the timezone selected "makes sense" otherwise = defaults to UTC, but what throws me off is that querying the database still= returns my original 'timezone' and not 'utc'.
Some more info:

this is the PS situat= ion on that server:

postgres=C2=A0 5236=C2=A0 0.0=C2=A0 0.2 342980=C2=A0 4852 ?=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 S=C2=A0=C2=A0=C2=A0 Oct23=C2=A0 20:02 /usr/b= in/postgres -D /var/lib/pgsql/data
postgres=C2=A0 5288=C2=A0 0.0=C2=A0 0= .0 195440=C2=A0 1004 ?=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Ss=C2=A0= =C2=A0 Oct23=C2=A0=C2=A0 0:00=C2=A0 \_ postgres: logger process
postgres= =C2=A0 5298=C2=A0 0.0=C2=A0 0.8 343388 15256 ?=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 Ss=C2=A0=C2=A0 Oct23=C2=A0=C2=A0 0:53=C2=A0 \_ postgres: ch= eckpointer process
postgres=C2=A0 5299=C2=A0 0.0=C2=A0 0.1 342980=C2=A0 = 2008 ?=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Ss=C2=A0=C2=A0 Oct23=C2=A0= =C2=A0 0:25=C2=A0 \_ postgres: writer process
postgres=C2=A0 5300=C2=A0 = 0.0=C2=A0 0.2 342980=C2=A0 5212 ?=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= Ss=C2=A0=C2=A0 Oct23=C2=A0=C2=A0 1:36=C2=A0 \_ postgres: wal writer proces= s
postgres=C2=A0 5301=C2=A0 0.0=C2=A0 0.0 343504=C2=A0 1708 ?=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Ss=C2=A0=C2=A0 Oct23=C2=A0=C2=A0 1:20=C2= =A0 \_ postgres: autovacuum launcher process
postgres=C2=A0 5302=C2=A0 0= .0=C2=A0 0.0 195828=C2=A0 1356 ?=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = Ss=C2=A0=C2=A0 Oct23=C2=A0=C2=A0 9:22=C2=A0 \_ postgres: stats collector pr= ocess
postgres 17078=C2=A0 0.0=C2=A0 0.1 344052=C2=A0 2224 ?=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Ss=C2=A0=C2=A0 Oct23=C2=A0=C2=A0 0:00=C2=A0 = \_ postgres: postgres dbbase [local] idle
postgres 31257=C2=A0 0.0=C2=A0= 0.0 343808=C2=A0 1304 ?=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Ss=C2=A0= =C2=A0 Dec05=C2=A0=C2=A0 0:00=C2=A0 \_ postgres: postgres dbbase 127.0.0.1(= 39728) idle
postgres 31258=C2=A0 0.0=C2=A0 0.0 343808=C2=A0 1300 ?=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Ss=C2=A0=C2=A0 Dec05=C2=A0=C2=A0 0:00= =C2=A0 \_ postgres: postgres dbbase 127.0.0.1(39732) idle
postgres 19698= =C2=A0 0.3=C2=A0 0.7 347208 14360 ?=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 Ss=C2=A0=C2=A0 Dec07=C2=A0 18:51=C2=A0 \_ postgres: postgres dbbase [lo= cal] idle
postgres 10441=C2=A0 0.0=C2=A0 0.2 344052=C2=A0 5580 ?=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Ss=C2=A0=C2=A0 17:13=C2=A0=C2=A0 0:00= =C2=A0 \_ postgres: postgres dbbase [local] idle


<= /div>
and netstat

# netstat -antup | grep 5432
tcp=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0 127.0.0.1:5432=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0.0.0.0:*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 31251/c2s
tcp6=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0 ::1:5432=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 :::*=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 LISTEN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 5= 236/postgres




<= div>So far I've tried faking time with both changing the time manually = and using ntp, but no matter what, the processes catch up to the real time,= so it's not a good test... and now I=C2=A0 have placed a server in a c= losed environment and made it believe it's Oct. 31st, turned off ntp, a= nd I'll keep observing.
If you guys can think of any add= itional logging/test I could turn on/launch over there to make sure I track= this possible behavior, that'd be cool

Th= ank you :)


On Tue, Dec 11, 2018 at 4:46 PM Tom Lane <tgl@sss.pgh.pa.us> wrote= :
=3D?utf-8?q?PG= _Bug_reporting_form?=3D <noreply@postgresql.org> writes:
> I have a bunch of servers that never restarted in the past couple of m= onths
> and had postgres running since before Nov. 4th and I discovered that t= heir
> default timezone changed in the background.

Hmph.=C2=A0 Ordinarily I'd expect that the default zone data would be c= ached
in the postmaster and inherited via fork() by backends, so that as long
as you didn't do something like change the timezone setting in
postgresql.conf, the behavior would be stable until postmaster restart.
(People who live in zones with frequent DST law changes have complained
of that ... but I'm not very much in a hurry to change it.)

So it's not at all clear what happened here.=C2=A0 I think that Red Hat= did
push out a tzdata update in early November, but even so, the behavior
of America/Los_Angeles shouldn't have changed.=C2=A0 *Maybe* this could=
be explained by having restarted those postmasters during the tiny
interval where the package update was happening and there wasn't anythi= ng
valid for /etc/localtime to point at --- but that stretches credulity.

If you can figure out a way to reproduce this, we'd be interested to hear what it is.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 regards, tom lane
--000000000000a7598f057cc938f7--