Re: Tighten up range checks for pg_resetwal arguments

From: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Tighten up range checks for pg_resetwal arguments
Date: 2025-12-05 18:49:30
Message-ID: 5ED2401E-C0FB-457D-942C-6FAFF1159740@yandex-team.ru
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 4 Dec 2025, at 00:07, Heikki Linnakangas <hlinnaka(at)iki(dot)fi> wrote:
>
> I got a little annoyed by how lax pg_resetwal is about out-of-range values.

A little bit offtopic, but anyway.

It's kind of common practice for many tools.
We actually had a corruption after pg_upgrade inflicted by the bug in upgrade script.
Here's the bugfix:
exe(
'/usr/bin/timeout 300 '
- 'sudo -u postgres /usr/lib/postgresql/{version_to}/bin/vacuumdb --port {port}'
+ 'sudo -u postgres /usr/lib/postgresql/{version_to}/bin/vacuumdb --port {port} '
'--analyze-in-stages --all -j 8',
context={'port': 7432},
allow_fail=True,
)

Absence of space was ignored by vacuumdb. Executed command:

vacuumdb --port 7432--analyze-in-stages

was expected to analyze only, but made a vacuum. That was not rsynced later.

So +1 from me on the strict parsing of arguments by sharp tools like pg_resetwal.

Best regards, Andrey Borodin.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Sami Imseih 2025-12-05 18:49:59 Re: Proposal: Add a callback data parameter to GetNamedDSMSegment
Previous Message Andrey Borodin 2025-12-05 18:36:42 Re: IPC/MultixactCreation on the Standby server