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

Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>

From: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Kevin Grittner <Kevin.Grittner@wicourts.gov>, drkp@csail.mit.edu, pgsql-hackers@postgreSQL.org
Date: 2011-06-13T19:22:19Z
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