pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Fujii Masao <masao.fujii@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Petr Jelinek <petr@2ndquadrant.com>
Cc: oonishitk@nttdata.co.jp, pgsql-docs <pgsql-docs@postgresql.org>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: [DOCS] max_worker_processes on the standby
Date: Fri, 4 Dec 2015 12:56:16 -0300
Message-ID: <20151204155616.GV2763@alvherre.pgsql> (raw)
In-Reply-To: <CAHGQGwFRDStn0jBS5GH_JwD-_PD+_tBe+yxFs5cq6LFxyLQ+bw@mail.gmail.com>
References: <CA+Tgmoaqmo-eSyBQu996Lko7AWu-Yij-Tjd1Zi-LM3UJmU2MKQ@mail.gmail.com>
	<20151002185941.GE2573@alvherre.pgsql>
	<CA+Tgmob_NQhUgbDCFEWBy6CanVG7mo5FuzPGR1_q9=7Gv+Q0cw@mail.gmail.com>
	<5622BF9D.2010409@2ndquadrant.com>
	<CA+TgmoYNUAt-7fJboXGOVcXmS_OeddhL+r5Tq3qDebdhJHR8mA@mail.gmail.com>
	<20151020190522.GT3391@alvherre.pgsql>
	<20151027180759.GG240637@alvherre.pgsql>
	<CAHGQGwEsKDoYFarJjQ4dvH2ZiDxxK0ZcBP4cV2ahdje5pRW2JA@mail.gmail.com>
	<20151116214338.GD614468@alvherre.pgsql>
	<CAHGQGwFRDStn0jBS5GH_JwD-_PD+_tBe+yxFs5cq6LFxyLQ+bw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

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



view thread (38+ messages)  latest in thread

Message-ID: <20151204155616.GV2763@alvherre.pgsql>
Permalink:  ../20151204155616.GV2763@alvherre.pgsql/
Also on:    postgresql.org/message-id/20151204155616.GV2763@alvherre.pgsql

 · 

reply

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, robertmhaas@gmail.com, petr@2ndquadrant.com, pgsql-docs@postgresql.org
  Subject: Re: [DOCS] max_worker_processes on the standby
  In-Reply-To: <20151204155616.GV2763@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