pg_resetwal: Corrections around -c option

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: pg_resetwal: Corrections around -c option
Date: 2023-09-28 13:50:43
Message-ID: d09f0e91-8757-642b-1a92-da9a52f5589a@eisentraut.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Branching off from [0], here is a for-discussion patch about some
corrections for the pg_resetwal -c (--commit-timestamp-ids) option.

First, in the documentation for finding a manual value for the -c option
based on the files present in the data directory, it was missing a
multiplier, like for the other SLRU-based values, and also missing the
mention of adding one for the upper value. The value I came up with is
computed as

SLRU_PAGES_PER_SEGMENT * COMMIT_TS_XACTS_PER_PAGE = 13088 = 0x3320

Second, the present pg_resetwal code hardcodes the minimum value as 2,
which is FrozenTransactionId, but it's not clear why that is allowed.
Maybe we should change that to FirstNormalTransactionId, which matches
other xid-related options in pg_resetwal.

Thoughts?

[0]:
https://www.postgresql.org/message-id/flat/0f3ab4a1-ae80-56e8-3426-6b4a02507687(at)eisentraut(dot)org

Attachment Content-Type Size
0001-WIP-pg_resetwal-Corrections-around-c-option.patch text/plain 3.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Vik Fearing 2023-09-28 13:50:58 Re: Allow deleting enumerated values from an existing enumerated data type
Previous Message Alvaro Herrera 2023-09-28 13:41:06 Re: Is it worth adding Assert(false) for unknown paths in print_path()?