public inbox for [email protected]  
help / color / mirror / Atom feed
From: Fujii Masao <[email protected]>
To: Alvaro Herrera <[email protected]>
Cc: Robert Haas <[email protected]>
Cc: Petr Jelinek <[email protected]>
Cc: [email protected]
Cc: pgsql-docs <[email protected]>
Cc: PostgreSQL-development <[email protected]>
Subject: Re: [DOCS] max_worker_processes on the standby
Date: Fri, 30 Oct 2015 01:41:13 +0900
Message-ID: <CAHGQGwEsKDoYFarJjQ4dvH2ZiDxxK0ZcBP4cV2ahdje5pRW2JA@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAHGQGwHRXGqSYoUf+aTf0icMq8Or6oBcEN+Y=2cZ4wLW_5acHw@mail.gmail.com>
	<[email protected]>
	<CAHGQGwGmpuWUHUcMXFrexgYjAvzn7a8mNdZfXzFG8aBjoXyd4w@mail.gmail.com>
	<[email protected]>
	<CA+Tgmoaqmo-eSyBQu996Lko7AWu-Yij-Tjd1Zi-LM3UJmU2MKQ@mail.gmail.com>
	<[email protected]>
	<CA+Tgmob_NQhUgbDCFEWBy6CanVG7mo5FuzPGR1_q9=7Gv+Q0cw@mail.gmail.com>
	<[email protected]>
	<CA+TgmoYNUAt-7fJboXGOVcXmS_OeddhL+r5Tq3qDebdhJHR8mA@mail.gmail.com>
	<[email protected]>
	<[email protected]>
List-Unsubscribe: <mailto:[email protected]?body=unsub%20pgsql-hackers>

On Wed, Oct 28, 2015 at 3:07 AM, Alvaro Herrera
<[email protected]> wrote:
> Alvaro Herrera wrote:
>> Robert Haas wrote:
>> > On Sat, Oct 17, 2015 at 5:37 PM, Petr Jelinek <[email protected]> wrote:
>> > > I agree with that sentiment.
>> > >
>> > > Attached patch adds variable to the shmem which is used for module
>> > > activation tracking - set to true in ActiveCommitTs() and false in
>> > > DeactivateCommitTs(). All the checks inside the commit_ts code were changed
>> > > to use this new variable. I also removed the static variable Alvaro added in
>> > > previous commit because it's not needed anymore.
>> >
>> > That sounds good to me.  On a quick read-through it looks OK too.
>>
>> A revised version is attached.
>
> Pushed.

I found another strange behavior on track_commit_timestamp.
Here are the steps to reproduce it.

1. Start the master and standby servers with track_commit_timestamp enabled.
    Since committs is activated in standby, pg_last_committed_xact() can
    successfully return the timestamp of last transaction as expected.

2. Disable track_commit_timestamp in the master and restart the master server.
    The parameter-change WAL record is streamed to the standby and committs
    is deactivated. pg_last_committed_xact() causes an ERROR in the standby.

3. Run checkpoint in the master.

4. Run restartpoint in the standby after the checkpoint WAL record generated
    in #3 is replicated to the standby.

5. Restart the standby server.
    Committs is activated in the standby because track_commit_timestamp is
    enabled. Since there is no parameter-change WAL record since last
    restartpoint, committs is not deactivated. So pg_last_committed_xact()
    can successfully return the timestamp.

6. Enable track_commit_timestamp in the master and restart the master server.

7. Disable track_commit_timestamp in the master and restart the master server.
    Back to the same situation as #2. That is, pg_last_committed_xact() causes
    an ERROR.

8. Promote the standby server to new master.
    Since committs is still inactive even after the promotion,
    pg_last_committed_xact() keeps causing an ERROR though
    track_commit_timestamp is on.

What I think strange is that pg_last_committed_xact() behaves differently
in #2, #5, and #7 though the settings of track_commit_timestamp are same
in both servers, i.e., it's disabled in the master but enabled in the standby.

I was thinking that whether committs is active or not should depend on
the setting of track_commit_timestamp *after* the promotion.
The behavior in #8 looked strange.

Regards,

-- 
Fujii Masao


-- 
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (38+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: [DOCS] max_worker_processes on the standby
  In-Reply-To: <CAHGQGwEsKDoYFarJjQ4dvH2ZiDxxK0ZcBP4cV2ahdje5pRW2JA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox