pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <hlinnakangas@vmware.com>
To: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Re: BUG #7969: Postgres Recovery Fatal With: "incorrect local pin count:2"
Date: Wed, 27 Mar 2013 21:04:47 +0200
Message-ID: <515342CF.1080805@vmware.com> (raw)
In-Reply-To: <51533A15.5010408@agliodbs.com>
References: <51533A15.5010408@agliodbs.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 27.03.2013 20:27, Josh Berkus wrote:
> Folks,
>
> So I'm a bit surprised that this bug report hasn't gotten a follow-up.
> Does this sound like the known 9.2.2 corruption issue, or is it
> potentially something else?

It seems like a new issue. At a quick glance, I think there's a bug in 
heap_xlog_update, ie. the redo routine of a heap update. If the new 
tuple is put on a different page, and at redo, the new page doesn't 
exist (that's normal if it was later vacuumed away), heap_xlog_update 
leaks a pin on the old page. Here:

> 	{
> 		nbuffer = XLogReadBuffer(xlrec->target.node,
> 								 ItemPointerGetBlockNumber(&(xlrec->newtid)),
> 								 false);
> 		if (!BufferIsValid(nbuffer))
> 			return;
> 		page = (Page) BufferGetPage(nbuffer);
>
> 		if (XLByteLE(lsn, PageGetLSN(page)))	/* changes are applied */
> 		{
> 			UnlockReleaseBuffer(nbuffer);
> 			if (BufferIsValid(obuffer))
> 				UnlockReleaseBuffer(obuffer);
> 			return;
> 		}
> 	}

Notice how in the first 'return' above, obuffer is not released.

I'll try to create a reproducible test case for this, and fix..

- Heikki


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (8+ messages)  latest in thread

Message-ID: <515342CF.1080805@vmware.com>
Permalink:  ../515342CF.1080805@vmware.com/
Also on:    postgresql.org/message-id/515342CF.1080805@vmware.com

 · 

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-bugs@postgresql.org
  Cc: hlinnakangas@vmware.com, josh@agliodbs.com
  Subject: Re: BUG #7969: Postgres Recovery Fatal With: "incorrect local pin count:2"
  In-Reply-To: <515342CF.1080805@vmware.com>
  References: <51533A15.5010408@agliodbs.com> <515342CF.1080805@vmware.com>

* 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