Re: Making pg_rewind faster
| От | Robert Haas |
|---|---|
| Тема | Re: Making pg_rewind faster |
| Дата | |
| Msg-id | CA+TgmoZU4Uy9aS_wYDbqD7=vcOE92KX1XG7xi2fuFYhbQeej2g@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: Making pg_rewind faster (Srinath Reddy Sadipiralla <srinath2133@gmail.com>) |
| Ответы |
Re: Making pg_rewind faster
|
| Список | pgsql-hackers |
On Wed, Oct 15, 2025 at 10:27 AM Srinath Reddy Sadipiralla <srinath2133@gmail.com> wrote: >> On Fri, Oct 10, 2025 at 12:45 AM Srinath Reddy Sadipiralla >> <srinath2133@gmail.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
В списке pgsql-hackers по дате отправления: