Re: BUG #18146: Rows reappearing in Tables after Auto-Vacuum Failure in PostgreSQL on Windows
От | Thomas Munro |
---|---|
Тема | Re: BUG #18146: Rows reappearing in Tables after Auto-Vacuum Failure in PostgreSQL on Windows |
Дата | |
Msg-id | CA+hUKGKvb3Dxs1NrfW4_cDZ7LMw4inSMqET5wceswnetWUZVqA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: BUG #18146: Rows reappearing in Tables after Auto-Vacuum Failure in PostgreSQL on Windows (Thomas Munro <thomas.munro@gmail.com>) |
Список | pgsql-bugs |
On Mon, Sep 9, 2024 at 7:21 PM Michael Paquier <michael@paquier.xyz> wrote: > The trick to use _mdfd_segpath() through smgrpreparetruncate() smells > too much of magic to me. I don't have an idea that does not involve > tweaking the interface of smgr.c or some of its structures on top of > my mind, though, which is to save the path before the critical section > and pass it through (like a memory area that can be used by > md.c).. Or do a MemoryContextAllowInCriticalSection, even if it is > not its original purpose. It's funny that it's so hard to get or store the pathnames when every single File knows its pathname, and segment 0 could give it to you: FilePathName(). Thinking about that made me notice that the vfd layer does raw strdup() and ERRORs on failure, so the thing I proposed might be adhering to the letter of the law ("no palloc in critical sections"), but not the spirit (the fd.c file opening stuff will throw ERRORs that are promoted to PANICs, exactly what that law intended to prevent). Mleugh. Another option would be to introduce mdtruncate2(old_nblocks, new_nblocks), so that it doesn't have to call smgrnblocks() itself, and you can obtain old_nblocks outside the CS...
В списке pgsql-bugs по дате отправления: