A question from Telegram chat: how to organize a transaction ID wraparound armageddon (of course, not in production), for educational purposes?
Created some straightforward recipe: t.me/postgreschat/1 – they say it works.
Could be a basis to train DBA's rescue activities?
Conversation
Replying to
Or just use pg_resetwal to shift the next one forward to skip past most of it? Unless you actually need the xids to be in use for something?
1
4
IMV we need a testing tool that simply burns through XIDs very quickly. I am wary of trusting "pg_resetwal -x" to simulate wraparound conditions - better to (almost) do wraparound for real. Greenplum takes this approach:
3
1
6
How about an initdb option to start XIDs near the wrap-around point? IIRC the Linux kernel did that for the jiffies counter to flush out bugs quicker.
3
Is it the actual wraparound that’s problematic, or the inability to freeze old XIDs? If the latter, then merely starting at (or resetting to) the wraparound point wouldn’t be sufficient to simulate such problems.
1
That's kind of a matter of perspective. If anti-wraparound VACUUM completes in the nick of time, technically everything is fine. Still, this "near miss" probably indicates a *systemic* problem for the system as a whole, including the user's app itself.




