Re: Should we add xid_current() or a int8->xid cast?
James Coleman <jtc331@gmail.com>
From: James Coleman <jtc331@gmail.com>
To: Mark Dilger <mark.dilger@enterprisedb.com>
Cc: Andres Freund <andres@anarazel.de>,
Alvaro Herrera <alvherre@2ndquadrant.com>, Thomas Munro <thomas.munro@gmail.com>,
Fujii Masao <masao.fujii@oss.nttdata.com>, Mark Dilger <hornschnorter@gmail.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>, Tom Lane <tgl@sss.pgh.pa.us>
Date: 2020-04-02T20:59:46Z
Lists: pgsql-hackers
On Thu, Apr 2, 2020 at 2:47 PM Mark Dilger <mark.dilger@enterprisedb.com> wrote: > > > > > On Apr 2, 2020, at 11:01 AM, Andres Freund <andres@anarazel.de> wrote: > > > >> > >> Hmm, for some reason I had it in my head that we would make these use an > >> "epoch/val" output format rather than raw uint64 values. > > > > Why would we do that? IMO the goal should be to reduce awareness of the > > 32bitness of normal xids from as many places as possible, and treat them > > as an internal space optimization. > > I agree with transitioning to 64-bit xids with 32 bit xid/epoch pairs as an internal implementation and storage detail only, but we still have user facing views that don't treat it that way. pg_stat_get_activity still returns backend_xid and backend_xmin as 32-bit, not 64-bit. Should this function change to be consistent? I'm curious what the user experience will be during the transitional period where some user facing xids are 64 bit and others (perhaps the same xids but viewed elsewhere) will be 32 bit. That might make it difficult for users to match them up. Agreed. The "benefit" (at least in the short term) of using the epoch/value style is that it makes (visual, at least) comparison with other (32-bit) xid values easier. I'm not sure if that's worth it, or if it's worth making a change depend on changing all of those views too. James
Commits
-
Introduce xid8-based functions to replace txid_XXX.
- 4c04be9b05ad 13.0 landed
-
Add SQL type xid8 to expose FullTransactionId to users.
- aeec457de8a8 13.0 landed
-
Replace the former method of determining snapshot xmax --- to wit, calling
- 6bd4f401b0cb 8.3.0 cited