Re: VACUUM/ANALYZE double-count the backend's own pending table stats

Поиск
Список
Период
Сортировка
Искать

Re: VACUUM/ANALYZE double-count the backend's own pending table stats

От:
Manu <manuelreyesbravo@gmail.com>
Дата:
Вложения:
Hi Ilya,

> about the two pre-existing TRUNCATE/subtransaction cases: yes, please
> send the repros.

Attached: p1 and p2. They reproduce on 14 through master, and neither
patch changes them, so they aren't from this one. Agreed they're better
as a separate, back-patchable patch; I left the probable fix area (the
truncdrop save/restore across subxacts) in a comment, no fix.

> Manu, if you had a way to pin that one too, I'd be glad to use it.

I did find a deterministic one (diffs attached, works on 14..master and
also catches the ins_since_vacuum case), but let me be upfront: it's
unconventional. The test function is marked IMMUTABLE only so it can be
indexed, and it does DML during ANALYZE (an armed expression index
inserts into the table whose TOAST the same VACUUM then cleans). A
committer may not want that in a test. The clean alternative is a
test-only injection point in the flush path, but that's a core change.

My honest lean is the injection point, or just leaving the VACUUM case
best-effort as you have it, rather than the index trick. Your call; the
diffs are there if you want them.

Regards,
Manu

Re: VACUUM/ANALYZE double-count the backend's own pending table stats

От:
Staroverov Ilja <i.staroverov@ftdata.ru>
Дата:
Hi Manu,

Thanks for the repros. I can confirm both on 18.6.

As for pinning the VACUUM case, I agree with your lean: an IMMUTABLE
function doing DML from an index expression during ANALYZE is likely
to put a committer off, and an injection point seems like too much for
a bug fix. So let's keep the VACUUM case best-effort, as it is in v2.

As for P1 and P2, would you like to take them to a separate thread
yourself? You found them and have already narrowed down where the fix
probably belongs. If you'd rather not, I'm happy to work on them, just
let me know.

--
Ilya Staroverov

FAQ