Hi,

I wonder if we should also back out of parallel_vacuum_init() when
pcxt->seg is NULL, like the parallel index builds do.

AFAICS, we otherwise go on to TidStoreCreateShared(), which needs
another DSM segment. That seems to defeat the leader-only fallback
when DSM slots stay exhausted. On master, with another session holding
every DSM slot, VACUUM (PARALLEL 2) fails with "too many dynamic shared
memory segments", while VACUUM (PARALLEL 0) succeeds.

The attached patch returns NULL there, letting the caller use a local
TidStore, and drops the nworkers check from cc053b6e127, which I think
becomes redundant?

Am I missing a reason to keep the shared TidStore in the no-worker case?

Regards,
Ayush

Attachment: v1-0001-Fall-back-to-serial-vacuum-when-out-of-DSM-segmen.patch
Description: Binary data

Reply via email to