Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZjsaU-0004wX-6G for pgsql-docs@arkaria.postgresql.org; Wed, 07 Oct 2015 17:33:10 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZjsaS-0002Ov-AG for pgsql-docs@arkaria.postgresql.org; Wed, 07 Oct 2015 17:33:08 +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 1Zjsa6-0001f5-T3; Wed, 07 Oct 2015 17:32:47 +0000 Received: from mail-qg0-x232.google.com ([2607:f8b0:400d:c04::232]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Zjsa4-0006I0-F1; Wed, 07 Oct 2015 17:32:45 +0000 Received: by qgx61 with SMTP id 61so21067141qgx.3; Wed, 07 Oct 2015 10:32:43 -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=zQzX2/giaqJa8QXWnzGznpqFqKWapXCS+RNLdab7nF4=; b=NBnguuUx4GSKmqENQqq6mPAD4wRO7UQkEFmGag39M6ynfg07J6v2XgWC/cR2tMWCvA CRM7nS1h2i9mI8J8KEov9dakzSvqB7lqyjnS7lgrDIkHRdxZJK402dxyB5XunfGgL1sc dzcN7+w8CtZ7qJh29L6Aorv2W7uiHjjUNkFUg0VhWaTdjAkDSY+6ie0FX2IsoV72NKDS BGhDHeuEj1CUe5s2z/NLJwgwSaYmrK3RSSwC0siKeaN2AKLo+djrc24ejKoVM+q8NDjp WrkKQnv79Z8PNanSzXE934M5kNtD3XiYjP/Yyu5ljiM/8sWYAnEUBtt9j23fx6gCECz2 A2Tg== MIME-Version: 1.0 X-Received: by 10.140.231.76 with SMTP id b73mr3237301qhc.87.1444239163627; Wed, 07 Oct 2015 10:32:43 -0700 (PDT) Received: by 10.55.44.7 with HTTP; Wed, 7 Oct 2015 10:32:43 -0700 (PDT) In-Reply-To: <20151002145839.GZ2573@alvherre.pgsql> References: <20150930224806.GR2573@alvherre.pgsql> <20151001181240.GT2573@alvherre.pgsql> <20151002145839.GZ2573@alvherre.pgsql> Date: Thu, 8 Oct 2015 02:32:43 +0900 Message-ID: Subject: Re: max_worker_processes on the standby From: Fujii Masao To: Alvaro Herrera Cc: 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-docs Precedence: bulk Sender: pgsql-docs-owner@postgresql.org On Fri, Oct 2, 2015 at 11:58 PM, Alvaro Herrera wrote: > 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. I'm afraid that this behavior might confuse the users. Please imagine the following scenario. 1. start up the server with track_commit_timestamp disabled 2. run several transactions 3. shut down the server with immediate mode 4. restart the server with track_commit_timestamp enabled 5. run "SELECT pg_last_committed_xact()" 6. run "SELECT pg_xact_commit_timestamp(xid) FROM pg_last_committed_xact()" 7. restart the server 8. run "SELECT pg_last_committed_xact()" Firstly, in #5, pg_last_committed_xact() returns the XID and timestamp of the last transaction which was executed in #2 (i.e., while track_commit_timestamp was disabled). This is confusing. I think that both pg_last_committed_xact() and pg_xact_commit_timestamp() should return only the transaction which was executed with track_commit_timestamp enabled. Secondly, SELECT query in #6 returns NULL. This means that pg_xact_commit_timestamp() may not handle the transaction which pg_last_committed_xact() handles. This is also confusing. Finally, in #8, pg_last_committed_xact() returns NULL while it returned non-NULL before the restart. This is also confusing. Regards, -- Fujii Masao -- Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-docs