pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Bernd Helmle <mailings@oopsware.de>
Cc: pgsql-hackers@postgresql.org
Subject: Re: standalone backend PANICs during recovery
Date: Sat, 2 Apr 2016 18:57:48 -0300
Message-ID: <20160402215748.GA136801@alvherre.pgsql> (raw)
In-Reply-To: <00F0B2CEF6D0CEF8A90119D4@eje.credativ.lan>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Bernd Helmle wrote:
> While investigating a problem on a streaming hot standby instance at a
> customer site, i got the following when using a standalone backend:
> 
> PANIC:  btree_xlog_delete_get_latestRemovedXid: cannot operate with
> inconsistent data
> CONTEXT:  xlog redo delete: index 1663/65588/65625; iblk 11, heap
> 1663/65588/65613;
> 
> The responsible PANIC is triggered here:
> 
> src/backend/access/nbtree/nbtxlog.c:555
> 
> btree_xlog_delete_get_latestRemovedXid(XLogReaderState *record)

This PANIC was introduced in the commit below.  AFAICS your proposed
patch and rationale are correct.


commit f786e91a75b2f64527dcf321e754b6448fcad7fe
Author:     Tom Lane <tgl@sss.pgh.pa.us>
AuthorDate: Fri Aug 3 15:41:18 2012 -0400
CommitDate: Fri Aug 3 15:41:18 2012 -0400

    Improve underdocumented btree_xlog_delete_get_latestRemovedXid() code.
    
    As noted by Noah Misch, btree_xlog_delete_get_latestRemovedXid is
    critically dependent on the assumption that it's examining a consistent
    state of the database.  This was undocumented though, so the
    seemingly-unrelated check for no active HS sessions might be thought to be
    merely an optional optimization.  Improve comments, and add an explicit
    check of reachedConsistency just to be sure.
    
    This function returns InvalidTransactionId (thereby killing all HS
    transactions) in several cases that are not nearly unlikely enough for my
    taste.  This commit doesn't attempt to fix those deficiencies, just
    document them.
    
    Back-patch to 9.2, not from any real functional need but just to keep the
    branches more closely synced to simplify possible future back-patching.



-- 
Á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 (18+ messages)  latest in thread

Message-ID: <20160402215748.GA136801@alvherre.pgsql>
Permalink:  ../20160402215748.GA136801@alvherre.pgsql/
Also on:    postgresql.org/message-id/20160402215748.GA136801@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@2ndquadrant.com, mailings@oopsware.de
  Subject: Re: standalone backend PANICs during recovery
  In-Reply-To: <20160402215748.GA136801@alvherre.pgsql>
  References: <00F0B2CEF6D0CEF8A90119D4@eje.credativ.lan> <20160402215748.GA136801@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