Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Zhqfj-0008Vm-TJ for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Oct 2015 03:06:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Zhqfj-0002Hc-7o for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Oct 2015 03:06:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1Zhqfg-0002EI-Uf; Fri, 02 Oct 2015 03:06:08 +0000 Received: from mail-qg0-x236.google.com ([2607:f8b0:400d:c04::236]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Zhqfe-0002tq-4o; Fri, 02 Oct 2015 03:06:08 +0000 Received: by qgez77 with SMTP id z77so85072638qge.1; Thu, 01 Oct 2015 20:06:03 -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=VpEeBsUlJfs0MN4AlPtcCz7BVdhrFoS9amJgSVm6k7g=; b=VtPnOGlwJ6aPm/T097+sNzEnb+hSNF/Nbgno89TVZaesHZmOiJwdQDhS7aGOpKb0Jc Q6wfG4NJFbE/4SXcOwax23AFGyr0sEQCvBUVwg0+l2HtZ+oj3/pQfSJyM7lNqt513B0P whThEv3m/BuGLfCM5DhtdU8JoIL+ejxSwWeq7VunoU/stEPHpEN2LNiR55JCgzmyZ7EB 4hcjan4rIyfGMWRqNrMIkHVoFdMg0x5utAr5kF+7K5dZ4W/M5MT3KERUWsdFRcReeygZ 8wwHW9g9bwFcyqRJV+fNt0BH6ZuldmcvX990xxC4xD/0Df+ZI81Jjl7Gwn2deixDtRA1 9WWA== MIME-Version: 1.0 X-Received: by 10.140.237.200 with SMTP id i191mr17702580qhc.5.1443755163738; Thu, 01 Oct 2015 20:06:03 -0700 (PDT) Received: by 10.55.44.7 with HTTP; Thu, 1 Oct 2015 20:06:03 -0700 (PDT) In-Reply-To: <20151001181240.GT2573@alvherre.pgsql> References: <20150930224806.GR2573@alvherre.pgsql> <20151001181240.GT2573@alvherre.pgsql> Date: Fri, 2 Oct 2015 12:06:03 +0900 Message-ID: Subject: Re: [DOCS] 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-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On Fri, Oct 2, 2015 at 3:12 AM, Alvaro Herrera wrote: > Fujii Masao wrote: > >> I've not read the patch yet, but the patched server with track_commit_timestamp >> enabled caused the following PANIC error when I ran pgbench. > > Ah, that was a stupid typo: I used || instead of &&. Fixed that. > > I also changed DeactivateCommitTs() so that it removes all slru segments > instead of leaving the last one around (which is what SimpleLruTruncate > was doing). This was noticeable when you ran a server with the feature > enabled (which created some files), then disabled it (which removed all > but the last) and ran for some more xacts; then enabled it again (which > created a new file, far ahead from the previously existing one). Since > the feature has enough protections that it doesn't have a problem with > no files at all being present, this works correctly. Note no > wal-logging of this operation: it's not necessary AFAICS because the > same deactivation routine would be called again in recovery and in > XLOG_PARAMETER_CHANGE, so it should be safe. 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. TRAP: FailedAssertion("!(((oldestCommitTs) != ((TransactionId) 0)) == ((newestCommitTs) != ((TransactionId) 0)))", File: "commit_ts.c", Line: 307) LOG: server process (PID 11160) was terminated by signal 6: Aborted DETAIL: Failed process was running: select num, pg_xact_commit_timestamp(num::text::xid) from generate_series(1750, 1800) num The steps to reproduce the problem is 1. Set up replication with track_commit_timestamp enabled. 2. Run several write transactions. 3. Disable track_commit_timestamp only in master and wait for XLOG_PARAMETER_CHANGE record to be replayed in standby. 4. Run pg_xact_commit_timestamp() in standby. 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