Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZrqGO-0004S9-BC for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Oct 2015 16:41:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZrqGN-0002jG-2F for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Oct 2015 16:41:19 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZrqGL-0002hw-HM; Thu, 29 Oct 2015 16:41:17 +0000 Received: from mail-qg0-x234.google.com ([2607:f8b0:400d:c04::234]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZrqGI-0008SS-RQ; Thu, 29 Oct 2015 16:41:16 +0000 Received: by qgbb65 with SMTP id b65so38999006qgb.2; Thu, 29 Oct 2015 09:41:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=YxZPgQ9M0NCn2gJlLPQch/qYzCe/KxYpGw4Yzo9QVVs=; b=ygTPYQFTjtRbIDiZOq51T+XgM6Emd3PMf3Wi8dMPl/EKr1NeJZN8w6//wexeTNSq50 UiFRZmmkqHxnu5VaPCyh9/Nr82rD3FX/BLGxEQ69PxkbBjkBPJCvLc62DkWXvz3vxbgG 30+XRRpKSfZYnYMj3oc9pyMaHi4T4xNMZsCbTViXHZjZzsUOvlY4zgPrtDreU2TCS8Ty aizYwo9sR41Egx4+/lZX3e/lgJQnDTEqKED3GbMo/caL9j6CEd57ckKsVXqmcco1mMhm gcbboTyTZaaURMRizEUnajGuI8DBfAsdYJYAe8j68mnyvYhy141TLQeHs+kWnLDh2eux ZdCw== MIME-Version: 1.0 X-Received: by 10.141.23.20 with SMTP id z20mr3809737qhd.52.1446136874017; Thu, 29 Oct 2015 09:41:14 -0700 (PDT) Received: by 10.55.44.7 with HTTP; Thu, 29 Oct 2015 09:41:13 -0700 (PDT) In-Reply-To: <20151027180759.GG240637@alvherre.pgsql> References: <20151001181240.GT2573@alvherre.pgsql> <20151002145839.GZ2573@alvherre.pgsql> <20151002185941.GE2573@alvherre.pgsql> <5622BF9D.2010409@2ndquadrant.com> <20151020190522.GT3391@alvherre.pgsql> <20151027180759.GG240637@alvherre.pgsql> Date: Fri, 30 Oct 2015 01:41:13 +0900 Message-ID: Subject: Re: [DOCS] max_worker_processes on the standby From: Fujii Masao To: Alvaro Herrera Cc: Robert Haas , Petr Jelinek , oonishitk@nttdata.co.jp, pgsql-docs , PostgreSQL-development Content-Type: text/plain; charset=UTF-8 X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On Wed, Oct 28, 2015 at 3:07 AM, Alvaro Herrera wrote: > Alvaro Herrera wrote: >> Robert Haas wrote: >> > On Sat, Oct 17, 2015 at 5:37 PM, Petr Jelinek 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 (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers