Re: txid_status() off-by-one error

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: txid_status() off-by-one error
Date: 2019-03-27 08:49:45
Message-ID: CA+hUKG+OtyDRxZ2Rq2sQp-nRqRb7F6G-xO9X-TC7rR5ERGB+Ow@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 27, 2019 at 7:55 PM Thomas Munro <thomas(dot)munro(at)gmail(dot)com> wrote:
> If you keep asking for txid_status(txid_current() + 1) in new
> transactions, you eventually hit:
>
> ERROR: could not access status of transaction 32768
> DETAIL: Could not read from file "pg_xact/0000" at offset 8192: No error: 0.

> - || (xid_epoch == now_epoch && xid > now_epoch_last_xid))
> + || (xid_epoch == now_epoch && xid >= now_epoch_last_xid))

Pushed and back-patched, along with renaming of that variable, s/last/next/.

--
Thomas Munro
https://enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Adrien NAYRAT 2019-03-27 09:22:20 Re: Log a sample of transactions
Previous Message Kyotaro HORIGUCHI 2019-03-27 08:30:37 Re: Protect syscache from bloating with negative cache entries