Re: Do XID sequences need to be contiguous? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Do XID sequences need to be contiguous?
Date
Msg-id 32485.1574976354@sss.pgh.pa.us
Whole thread Raw
In response to Do XID sequences need to be contiguous?  (Mark Dilger <hornschnorter@gmail.com>)
List pgsql-hackers
Mark Dilger <hornschnorter@gmail.com> writes:
> While working on the problem of XID wraparound within the LISTEN/NOTIFY
> system, I tried to increment XIDs by more than one per transaction. 
> This leads to a number of test failures, many which look like:

IIRC, the XID-creation logic is designed to initialize the next clog
page whenever it allocates an exact-multiple-of-BLCKSZ*4 transaction
number.  Skipping over such numbers would create trouble.

> First, I'd like a good method of burning through transaction ids in
> tests designed to check for problems in XID wrap-around.

Don't "burn through them".  Stop the cluster and use pg_resetwal to
set the XID counter wherever you want it.  (You might need to set it
just before a page or segment boundary; I'm not sure if pg_resetwal
has any logic of its own to initialize a new CLOG page/file when you
move the counter this way.  Perhaps it's worth improving that.)

> Second, I'd like to add Asserts where appropriate regarding this
> assumption.

I'm not excited about that, and it's *certainly* not a problem that
justifies additional configure infrastructure.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Alexander Lakhin
Date:
Subject: Re: pg_upgrade fails to preserve old versions of the predefinedcollations
Next
From: Thomas Munro
Date:
Subject: Re: checkpointer: PANIC: could not fsync file: No such file or directory