Re: Usage of epoch in txid_current

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Usage of epoch in txid_current
Date: 2018-07-10 04:20:18
Message-ID: CAEepm=2KeC8xDbEWgDTDObXGqPHFW4kcD7BZXR6NMfiHjjnKhQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

On Tue, Jul 10, 2018 at 2:15 PM, Thomas Munro
<thomas(dot)munro(at)enterprisedb(dot)com> wrote:
> On Tue, Jul 10, 2018 at 1:30 PM, Andres Freund <andres(at)anarazel(dot)de> wrote:,
>>> (errmsg_internal("next transaction ID: %u:%u; next OID: %u",
>>> - checkPoint.nextXidEpoch, checkPoint.nextXid,
>>> + EpochFromFullTransactionId(checkPoint.nextFullXid),
>>> + XidFromFullTransactionId(checkPoint.nextFullXid),
>>> checkPoint.nextOid)));
>>
>> I don't think we should continue to expose epochs, but rather go to full
>> xids where appropriate.
>
> OK, done.

Ugh. When I changed pg_resetwal.c to print out the 64 bit value, I
broke controldata.c's code that reads those strings back in, as
revealed by a failing pg_upgrade test in check-world that I should
have waited for. Perhaps we shouldn't change that output format...
though I think it does make sense to move forwards here (and probably
eventually for the other values too). So here is a version that fixes
the parsing problem. Unfortunately pg_upgrade is not allowed to use
pg_strtouint64() so for now I jammed the same macrology into
controldata.c, but I assume that could be sorted out.

--
Thomas Munro
http://www.enterprisedb.com

Attachment Content-Type Size
0001-Track-the-next-xid-using-64-bits-v4.patch application/octet-stream 46.3 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-07-10 06:04:05 Re: Recovery performance of DROP DATABASE with many tablespaces
Previous Message Etsuro Fujita 2018-07-10 03:38:40 Re: Expression errors with "FOR UPDATE" and postgres_fdw with partition wise join enabled.