Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5iFh-0000yQ-V3 for pgsql-bugs@arkaria.postgresql.org; Wed, 25 May 2016 23:30:14 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1b5iFh-0006xc-Hn for pgsql-bugs@arkaria.postgresql.org; Wed, 25 May 2016 23:30:13 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1b5iFg-0006tg-AT; Wed, 25 May 2016 23:30:12 +0000 Received: from smtp-auth.no-ip.com ([8.23.224.61] helo=out.smtp-auth.no-ip.com) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1b5iFd-0006hd-1X; Wed, 25 May 2016 23:30:11 +0000 X-No-IP: alvh.no-ip.org@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from alvin.alvh.no-ip.org (unknown [216.155.90.98]) (Authenticated sender: alvh.no-ip.org@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id CDE59401FAE; Wed, 25 May 2016 16:30:02 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 03FC5751; Wed, 25 May 2016 19:30:01 -0400 (CLT) Date: Wed, 25 May 2016 19:30:00 -0400 From: Alvaro Herrera To: Marco Nenciarini Cc: pgsql-bugs@postgresql.org, PostgreSQL-development Subject: Re: [HACKERS] BUG #13473: VACUUM FREEZE mistakenly cancel standby sessions Message-ID: <20160525233000.GA634903@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <52fb5d06-ac66-ea1e-c6fd-46949d17962e@2ndquadrant.it> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -1.1 (-) 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 Marco Nenciarini wrote: > diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c > index eb8eada..434880a 100644 > --- a/src/backend/access/heap/heapam.c > +++ b/src/backend/access/heap/heapam.c > @@ -4764,7 +4764,13 @@ heap_xlog_freeze(XLogRecPtr lsn, XLogRecord *record) > * consider the frozen xids as running. > */ > if (InHotStandby) > - ResolveRecoveryConflictWithSnapshot(cutoff_xid, xlrec->node); > + { > + TransactionId latestRemovedXid = cutoff_xid; > + > + TransactionIdRetreat(latestRemovedXid); > + > + ResolveRecoveryConflictWithSnapshot(latestRemovedXid, xlrec->node); > + } > > /* If we have a full-page image, restore it and we're done */ > if (record->xl_info & XLR_BKP_BLOCK(0)) Actually, in 9.3 there's a heap_xlog_freeze routine and a separate heap_xlog_freeze_page routine; see commit 8e9a16ab8f7f. Applying this patch to that branch leaves heap_xlog_freeze itself unmodified, and only heap_xlog_freeze_page is updated. I think this is pretty much harmless, as the older routine would only be called by a standby running a minor version earlier than that commit, which has its own set of much more serious bugs. But I think the safest route is to patch them both, so I'm going to do that. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs