Re: SSI patch renumbered existing 2PC resource managers?? - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: SSI patch renumbered existing 2PC resource managers??
Date
Msg-id 4DF6636B.7070703@enterprisedb.com
Whole thread Raw
In response to SSI patch renumbered existing 2PC resource managers??  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: SSI patch renumbered existing 2PC resource managers??
Re: SSI patch renumbered existing 2PC resource managers??
List 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


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: SSI patch renumbered existing 2PC resource managers??
Next
From: Peter Eisentraut
Date:
Subject: Re: [PATCH] Bug in XPATH() if expression returns a scalar value