From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | Srinath Reddy Sadipiralla <srinath2133(at)gmail(dot)com> |
Cc: | John H <johnhyvr(at)gmail(dot)com>, wenhui qiu <qiuwenhuifx(at)gmail(dot)com>, Japin Li <japinli(at)hotmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Andres Freund <andres(at)anarazel(dot)de>, Alexander Korotkov <aekorotkov(at)gmail(dot)com>, Justin Kwan <justinpkwan(at)outlook(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, vignesh <vignesh(at)cloudflare(dot)com>, vignesh ravichandran <admin(at)viggy28(dot)dev>, "hlinnaka(at)iki(dot)fi" <hlinnaka(at)iki(dot)fi>, "jkwan(at)cloudflare(dot)com" <jkwan(at)cloudflare(dot)com> |
Subject: | Re: Making pg_rewind faster |
Date: | 2025-10-16 18:59:48 |
Message-ID: | CA+TgmoZU4Uy9aS_wYDbqD7=vcOE92KX1XG7xi2fuFYhbQeej2g@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Wed, Oct 15, 2025 at 10:27 AM Srinath Reddy Sadipiralla
<srinath2133(at)gmail(dot)com> wrote:
>> On Fri, Oct 10, 2025 at 12:45 AM Srinath Reddy Sadipiralla
>> <srinath2133(at)gmail(dot)com> wrote:
>> > XLogFilePath , then validate this new path with the given path
>> > ,this helps to catch invalid xlog files like pg_wal/00000001FFFFFFFFFFFFFF10.
>> > ...
>>
>> Are you concerned that somehow these files, which are named like XLog
>> files but actually
>> aren't, are somehow created therefore we should sync them in case?
>> I'm trying to understand how these files would be generated in the first place.
>
> the problem is not when server generates them because
> filename is properly calculated using the XLogRecPtr in
> XLogWrite->XLogFileInit->XLogFileInitInternal->XLogFilePath
> ,the main problem is when if someone manually places an invalid WAL file
> in pg_wal like 00000001FFFFFFFFFFFFFF10, IsXLogFileName will
> consider it as valid ,so with the approach as i mentioned earlier we can
> catch such cases.
I think that parsing the file name may be a good idea so that we can
do appropriate sanity checks on the values (e.g. checking that we're
only skipping copying prior to last_common_segno), but I do not think
we should worry too much about the user manually injecting invalid WAL
files. I mean, I would prefer that if that does happen, it either
works anyway or fails with a sensible error message, rather than
emitting an incomprehensible error message or dumping core. But, it is
in general true that if manual modifications are made to the data
directory, things may go terribly wrong, and this code is not obliged
to provide any more protection against such scenarios than we do in
other cases. Ultimately, such modifications are user error.
--
Robert Haas
EDB: http://www.enterprisedb.com
From | Date | Subject | |
---|---|---|---|
Next Message | Alexander Lakhin | 2025-10-16 19:00:00 | Re: Instability of phycodorus in pg_upgrade tests with JIT |
Previous Message | Dimitrios Apostolou | 2025-10-16 18:59:05 | Re: [PING] [PATCH v2] parallel pg_restore: avoid disk seeks when jumping short distance forward |