Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W108I-00076c-AE for pgsql-bugs@arkaria.postgresql.org; Wed, 08 Jan 2014 20:53:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1W108H-0000ye-P7 for pgsql-bugs@arkaria.postgresql.org; Wed, 08 Jan 2014 20:53:45 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W108G-0000wa-NE for pgsql-bugs@postgresql.org; Wed, 08 Jan 2014 20:53:44 +0000 Received: from smtp-outbound-1.vmware.com ([208.91.2.12]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W108C-0001Ni-NS for pgsql-bugs@postgresql.org; Wed, 08 Jan 2014 20:53:43 +0000 Received: from sc9-mailhost3.vmware.com (sc9-mailhost3.vmware.com [10.113.161.73]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 9E03A28A1B for ; Wed, 8 Jan 2014 12:53:36 -0800 (PST) Received: from zcs-prod-ext-mta-2.vmware.com (zcs-prod-ext-mta-2.vmware.com [10.113.62.224]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id 997D040178 for ; Wed, 8 Jan 2014 12:53:36 -0800 (PST) Received: from zcs-prod-ext-mta-2.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-2.vmware.com (Postfix) with ESMTP id 1331CC0040 for ; Wed, 8 Jan 2014 12:54:10 -0800 (PST) Received: from [192.168.1.90] (zimbra-prod-ext-proxy-vip.vmware.com [10.113.63.87]) by zcs-prod-ext-mta-2.vmware.com (Postfix) with ESMTPSA for ; Wed, 8 Jan 2014 12:54:09 -0800 (PST) Message-ID: <52CDBACE.2080204@vmware.com> Date: Wed, 08 Jan 2014 22:53:34 +0200 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131005 Icedove/17.0.9 MIME-Version: 1.0 To: Pg Bugs Subject: Pausing at recovery target is off by one Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -7.0 (-------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org pause_at_recovery_target doesn't do what I would expect when recovery_target_inclusive='true' (which is the default). It pauses before applying the target record, but if you then call pg_xlog_replay_resume() to bring the system up, it will apply that one more record, before exiting recovery. For example, if you do this in the master: insert into foo values (5); Then crawl the WAL with pg_xlogdump to find the XID of that transaction, and set recovery target to that: recovery_target_xid='213890' recovery_target_inclusive='true' pause_at_recovery_target='true' Now you connect to the paused system and verify that the state looks OK, and call pg_xlog_replay(). Oops, the state it recovers to is not what you expected: postgres=# select ctid,* from foo; ctid | i -------+--- (0,1) | 1 (0,2) | 2 (0,3) | 3 (0,4) | 4 (4 rows) postgres=# select pg_xlog_replay_resume(); pg_xlog_replay_resume ----------------------- (1 row) postgres=# select ctid,* from foo; ctid | i -------+--- (0,1) | 1 (0,2) | 2 (0,3) | 3 (0,4) | 4 (0,5) | 5 (5 rows) I think this is a bug, and needs to be fixed. - Heikki -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs