From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Cc: pgsql-bugs@postgresql.org, PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] BUG #13473: VACUUM FREEZE mistakenly cancel standby sessions
Date: Wed, 25 May 2016 19:30:00 -0400
Message-ID: <20160525233000.GA634903@alvherre.pgsql> (raw)
In-Reply-To: <52fb5d06-ac66-ea1e-c6fd-46949d17962e@2ndquadrant.it>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
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
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: alvherre@2ndquadrant.com, marco.nenciarini@2ndquadrant.it, pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] BUG #13473: VACUUM FREEZE mistakenly cancel standby sessions
In-Reply-To: <20160525233000.GA634903@alvherre.pgsql>
References: <52fb5d06-ac66-ea1e-c6fd-46949d17962e@2ndquadrant.it> <20160525233000.GA634903@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