Re: SSI patch renumbered existing 2PC resource managers??

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, drkp(at)csail(dot)mit(dot)edu, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: SSI patch renumbered existing 2PC resource managers??
Date: 2011-06-13 19:22:19
Message-ID: 4DF6636B.7070703@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 13.06.2011 21:31, Tom Lane wrote:
> So I finally started actually reading the SSI changes, and I am a tad
> distressed by this:
>
> diff --git a/src/include/access/twophase_rmgr.h b/src/include/access/twophase_rmgr.h
> index a541d0f..1c7d8bb 100644
> --- a/src/include/access/twophase_rmgr.h
> +++ b/src/include/access/twophase_rmgr.h
> @@ -23,8 +23,9 @@ typedef uint8 TwoPhaseRmgrId;
> */
> #define TWOPHASE_RM_END_ID 0
> #define TWOPHASE_RM_LOCK_ID 1
> -#define TWOPHASE_RM_PGSTAT_ID 2
> -#define TWOPHASE_RM_MULTIXACT_ID 3
> +#define TWOPHASE_RM_PREDICATELOCK_ID 2
> +#define TWOPHASE_RM_PGSTAT_ID 3
> +#define TWOPHASE_RM_MULTIXACT_ID 4
> #define TWOPHASE_RM_MAX_ID TWOPHASE_RM_MULTIXACT_ID
>
> extern const TwoPhaseCallback twophase_recover_callbacks[];
>
> What was the rationale for changing the assignments of existing 2PC IDs?

As far as I can tell it was for purely cosmetic reasons, to have lock
and predicate lock lines together.

> So far as I can tell, that breaks pg_upgrade (if there are any open
> prepared transactions) for no redeeming social benefit.

Surely pg_upgrade can't work anyway if there's any open prepared
transactions in the database. We're not going to guarantee to keep all
the data structures we write in two-phase state files unchanged over
major releases. If pg_upgrade is not checking for prepared transcations
at the moment, such a check should probably should be added.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2011-06-13 19:24:49 Re: [PATCH] Bug in XPATH() if expression returns a scalar value
Previous Message Kevin Grittner 2011-06-13 19:15:52 Re: SSI patch renumbered existing 2PC resource managers??