pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Marko Tiikkaja <marko@joh.to>
Cc: Andres Freund <andres@2ndquadrant.com>
Cc: hackers <pgsql-hackers@postgresql.org>
Subject: Re: ERROR:  cannot GetMultiXactIdMembers() during recovery
Date: Mon, 18 May 2015 13:48:03 -0300
Message-ID: <20150518164803.GP2523@alvh.no-ip.org> (raw)
In-Reply-To: <5555F1E2.5080104@joh.to>
References: <54EB3283.2080305@joh.to>
	<20150223141300.GB30784@awork2.anarazel.de>
	<5555F1E2.5080104@joh.to>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Marko Tiikkaja wrote:
> Hi hackers,
> 
> Any chance to get this fixed in time for 9.1.16?

I hope you had pinged some days earlier.  Here's a patch, but I will
wait until this week's releases have been tagged before pushing.

I checked 9.2, and it doesn't look like it's subject to the same
problem: instead of HeapTupleSatisfiesVacuum, it uses
HeapTupleIsSurelyDead in the equivalent place.  Still, I think it's
saner to apply the same bug because as Andres notes the problem might
still be present in pgrowlocks and who knows what else.

-- 
Á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

Attachments:

multixact-in-recovery.patch (text/x-diff, 853B) download diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c index 476c53d..b90c110 100644 --- a/src/backend/access/transam/multixact.c +++ b/src/backend/access/transam/multixact.c @@ -383,6 +383,21 @@ MultiXactIdIsRunning(MultiXactId multi) debug_elog3(DEBUG2, "IsRunning %u?", multi); + /* + * During recovery, all multixacts can be considered not running: in + * effect, tuple locks are not held in standby servers, which is fine + * because the standby cannot acquire further tuple locks nor update/delete + * tuples. + * + * We need to do this first, because GetMultiXactIdMembers complains if + * called on recovery. + */ + if (RecoveryInProgress()) + { + debug_elog2(DEBUG2, "IsRunning: in recovery"); + return false; + } + nmembers = GetMultiXactIdMembers(multi, &members); if (nmembers < 0)

view thread (14+ messages)  latest in thread

Message-ID: <20150518164803.GP2523@alvh.no-ip.org>
Permalink:  ../20150518164803.GP2523@alvh.no-ip.org/
Also on:    postgresql.org/message-id/20150518164803.GP2523@alvh.no-ip.org

 ·  · 

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, marko@joh.to, andres@2ndquadrant.com
  Subject: Re: ERROR:  cannot GetMultiXactIdMembers() during recovery
  In-Reply-To: <20150518164803.GP2523@alvh.no-ip.org>

* 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