Re: [BUGS] BUG #13473: VACUUM FREEZE mistakenly cancel standby sessions
| От | Alvaro Herrera | 
|---|---|
| Тема | Re: [BUGS] BUG #13473: VACUUM FREEZE mistakenly cancel standby sessions | 
| Дата | |
| Msg-id | 20160525233000.GA634903@alvherre.pgsql обсуждение исходный текст | 
| Ответ на | Re: [BUGS] BUG #13473: VACUUM FREEZE mistakenly cancel standby sessions (Marco Nenciarini <marco.nenciarini@2ndquadrant.it>) | 
| Список | pgsql-hackers | 
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
		
	В списке pgsql-hackers по дате отправления: