Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1a4sin-0006dD-Re for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Dec 2015 15:56:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1a4sin-00042v-D0 for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Dec 2015 15:56:33 +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 1a4sil-0003zY-2U; Fri, 04 Dec 2015 15:56:31 +0000 Received: from out.smtp-auth.no-ip.com ([8.23.224.60]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1a4sig-0000iJ-Ad; Fri, 04 Dec 2015 15:56:30 +0000 X-No-IP: alvh.no-ip.org@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from alvin.alvh.no-ip.org (unknown [200.104.53.52]) (Authenticated sender: alvh.no-ip.org@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id AA249400F43; Fri, 4 Dec 2015 07:56:19 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 4F09E897; Fri, 4 Dec 2015 12:56:16 -0300 (CLT) Date: Fri, 4 Dec 2015 12:56:16 -0300 From: Alvaro Herrera To: Fujii Masao Cc: Robert Haas , Petr Jelinek , oonishitk@nttdata.co.jp, pgsql-docs , PostgreSQL-development Subject: Re: [DOCS] max_worker_processes on the standby Message-ID: <20151204155616.GV2763@alvherre.pgsql> References: <20151002185941.GE2573@alvherre.pgsql> <5622BF9D.2010409@2ndquadrant.com> <20151020190522.GT3391@alvherre.pgsql> <20151027180759.GG240637@alvherre.pgsql> <20151116214338.GD614468@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -2.6 (--) 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 Fujii Masao wrote: > Sorry for not reviewing the patch before you push it... > > In HEAD, I ran very simple test case: > > 1. enable track_commit_timestamp > 2. start the server > 3. run some transactions > 4. execute pg_last_committed_xact() -- returns non-null values > 5. shutdown the server with immdiate mode > 6. restart the server -- crash recovery happens > 7. execute pg_last_committed_xact() > > The last call of pg_last_committed_xact() returns NULL values, which means > that the xid and timestamp information of the last committed transaction > disappeared by crash recovery. Isn't this a bug? Hm, not really, because the status of the "last" transaction is kept in shared memory as a cache and not expected to live across a restart. However, I tested the equivalent scenario: alvherre=# create table fg(); CREATE TABLE alvherre=# select ts.* from pg_class,pg_xact_commit_timestamp(xmin) ts where relname = 'fg'; ts ------------------------------- 2015-12-04 12:41:48.017976-03 (1 fila) then crash the server, and after recovery the data is gone: alvherre=# select ts.*, xmin, c.relname from pg_class c,pg_xact_commit_timestamp(xmin) ts where relname = 'fg'; ts | xmin | relname ----+------+--------- | 630 | fg (1 fila) Not sure what is going on; my reading of the code certainly says that the data should be there. I'm looking into it. I also noticed that I didn't actually push the whole of the patch yesterday -- I neglected to "git add" the latest changes, the ones that fix the promotion scenario :-( so the commit messages is misleading because it describes something that's not there. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers