From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Fujii Masao <masao.fujii@gmail.com>
Cc: oonishitk@nttdata.co.jp, pgsql-docs <pgsql-docs@postgresql.org>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: max_worker_processes on the standby
Date: Fri, 2 Oct 2015 11:58:39 -0300
Message-ID: <20151002145839.GZ2573@alvherre.pgsql> (raw)
In-Reply-To: <CAHGQGwGmpuWUHUcMXFrexgYjAvzn7a8mNdZfXzFG8aBjoXyd4w@mail.gmail.com>
References: <ca44c6c7f9314868bdc521aea4f77cbf@MP-MSGSS-MBX004.msg.nttdata.co.jp>
<CAHGQGwHereDzzzmfxEBYcVQu3oZv6vZcgu1TPeERWbDc+gQ06g@mail.gmail.com>
<20150930224806.GR2573@alvherre.pgsql>
<CAHGQGwHRXGqSYoUf+aTf0icMq8Or6oBcEN+Y=2cZ4wLW_5acHw@mail.gmail.com>
<20151001181240.GT2573@alvherre.pgsql>
<CAHGQGwGmpuWUHUcMXFrexgYjAvzn7a8mNdZfXzFG8aBjoXyd4w@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-docs>
Fujii Masao wrote:
> What happens if pg_xact_commit_timestamp() is called in standby after
> track_commit_timestamp is disabled in master, DeactivateCommitTs() is
> called and all commit_ts files are removed in standby? I tried that case
> and got the following assertion failure.
Ah. So the standby needs to keep the module activated if it's enabled
locally, even when it receives a message that the master turned it off.
Here's a patch.
Thanks for your continued testing!
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docsAttachments:committs.patch (text/x-diff, 1.0K) download
commit 7441f88b746b7522f1714ed9fec95c3c4fe1dacb[m
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
AuthorDate: Fri Oct 2 11:39:44 2015 -0300
CommitDate: Fri Oct 2 11:39:44 2015 -0300
Don't disable commit_ts in standby if enabled locally
Bug noticed by Fujii Masao
diff --git a/src/backend/access/transam/commit_ts.c b/src/backend/access/transam/commit_ts.cindex 79ca04a..24b8291 100644--- a/src/backend/access/transam/commit_ts.c+++ b/src/backend/access/transam/commit_ts.c@@ -583,14 +583,15 @@ CommitTsParameterChange(bool newvalue, bool oldvalue)
* pg_control. If the old value was already set, we already did this, so
* don't do anything.
*
- * If the module is disabled in the master, disable it here too.+ * If the module is disabled in the master, disable it here too, unless+ * the module is enabled locally.
*/
if (newvalue)
{
if (!track_commit_timestamp && !oldvalue)
ActivateCommitTs();
}
- else if (oldvalue)+ else if (!track_commit_timestamp && oldvalue)
DeactivateCommitTs(false);
}
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: pgsql-hackers@postgresql.org
Cc: alvherre@2ndquadrant.com, masao.fujii@gmail.com, pgsql-docs@postgresql.org
Subject: Re: max_worker_processes on the standby
In-Reply-To: <20151002145839.GZ2573@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox