Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YuOCQ-0004Gu-Hu for pgsql-hackers@arkaria.postgresql.org; Mon, 18 May 2015 16:47:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YuOCQ-000729-25 for pgsql-hackers@arkaria.postgresql.org; Mon, 18 May 2015 16:47:30 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YuOCO-000722-I4 for pgsql-hackers@postgresql.org; Mon, 18 May 2015 16:47:28 +0000 Received: from mail-qc0-f181.google.com ([209.85.216.181]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1YuOCL-00025w-K9 for pgsql-hackers@postgresql.org; Mon, 18 May 2015 16:47:27 +0000 Received: by qcir1 with SMTP id r1so25781043qci.3 for ; Mon, 18 May 2015 09:47:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=cjyalqcPUXrjXzBNcMoKd7YBgfZqL3VaFce6u2rfIww=; b=ih0sQy/hWoViv/1jf+O7eskIuneB7j5UatqEffpon6AneEHR7eR+cizrFrhcbMzJrB PWqVIqDs9rUPC4shDVfhlThXd7WnLpHD++bkz+9e8a3wrkZoH3dL/qds4qj7lotjgSuS 5hoUk1YHgfNdvD4kK9VMqubZO+FyrY84ofPHqjnooeQbvy3zK+q8aQk/IqgmFVuyU7tY IljqiiWRsCqzUp/0uAPAnuC6dMpFfmw5RDV7GDRCHqpzERscmCezRmU/SWoOEY+FE+cv hN/GDTdGvePG90ba0/n3deOcZ0mRSlzmpSfBxJvNtZPNYBlaTBvgXTpMFT6jnjs/eJmm uVLQ== X-Gm-Message-State: ALoCoQkRvxWfjSaMakLDCL6T1ukVfGZhNTzUdpEi1Tlu1ssHcpco3fhXkY+NP3JM8h60vDI2yLI/ X-Received: by 10.140.99.65 with SMTP id p59mr30248200qge.46.1431967644548; Mon, 18 May 2015 09:47:24 -0700 (PDT) Received: from alvin.alvh.no-ip.org ([181.43.8.141]) by mx.google.com with ESMTPSA id n83sm7369019qkh.31.2015.05.18.09.47.23 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 May 2015 09:47:23 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 99D682112; Mon, 18 May 2015 13:48:03 -0300 (CLT) Date: Mon, 18 May 2015 13:48:03 -0300 From: Alvaro Herrera To: Marko Tiikkaja Cc: Andres Freund , hackers Subject: Re: ERROR: cannot GetMultiXactIdMembers() during recovery Message-ID: <20150518164803.GP2523@alvh.no-ip.org> References: <54EB3283.2080305@joh.to> <20150223141300.GB30784@awork2.anarazel.de> <5555F1E2.5080104@joh.to> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="aF3LVLvitz/VQU3c" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5555F1E2.5080104@joh.to> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org --aF3LVLvitz/VQU3c Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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 --aF3LVLvitz/VQU3c Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="multixact-in-recovery.patch" 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) --aF3LVLvitz/VQU3c Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --aF3LVLvitz/VQU3c--