Re: Overhauling "Routine Vacuuming" docs, particularly its handling of freezing

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Maciek Sakrejda <m(dot)sakrejda(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, John Naylor <john(dot)naylor(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Overhauling "Routine Vacuuming" docs, particularly its handling of freezing
Date: 2023-05-01 19:35:29
Message-ID: CAH2-Wzkr8WTGnpoc+zxHAbPTeuWm77Yx0XT4QtQCpW7KS4nuRg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, May 1, 2023 at 12:03 PM Maciek Sakrejda <m(dot)sakrejda(at)gmail(dot)com> wrote:
> I don't want to put words into Peter's mouth, but I think that he's arguing that the term "wraparound" suggests that there is something special about the transition between xid 2^32 and xid 0 (or, well, 3). There isn't.

Yes, that's exactly what I mean. There are two points that seem to be
very much in tension here:

1. The scenario where you corrupt the database in single user mode by
unsafely allocating XIDs (you need single user mode to bypass the
xidStopLimit protections) generally won't involve unsigned integer
wraparound (and if it does it's *entirely* incidental to the data
corruption).

2. Actual unsigned integer wraparound is 100% harmless and routine, by design.

So why do we use the term wraparound as a synonym of "the end of the
world"? I assume that it's just an artefact of how the system worked
before the invention of freezing. Back then, you had to do a dump and
restore when the system reached about 4 billion XIDs. Wraparound
really did mean "the end of the world" over 20 years ago.

This is related to my preference for explaining the issues with
reference to a 64-bit XID space. Today we compare 64-bit XIDs using
simple unsigned integer comparisons. That's the same way that 32-bit
XID comparisons worked before freezing was invented in 2001. So it
really does seem like the natural way to explain it.

--
Peter Geoghegan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2023-05-01 20:24:30 Re: [PATCH] Support % wildcard in extension upgrade filenames
Previous Message Maciek Sakrejda 2023-05-01 19:03:38 Re: Overhauling "Routine Vacuuming" docs, particularly its handling of freezing