Re: Parallel autovacuum: leader crashes when no DSM segment can be created - Mailing list pgsql-hackers

From Ayush Tiwari
Subject Re: Parallel autovacuum: leader crashes when no DSM segment can be created
Date
Msg-id CAJTYsWVvGOGmyXVjjOwC4-R31Lp1iay27jR5tukr+CTh2JefMA@mail.gmail.com
Whole thread
In response to Re: Parallel autovacuum: leader crashes when no DSM segment can be created  (Masahiko Sawada <sawada.mshk@gmail.com>)
List pgsql-hackers
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

pgsql-hackers by date:

Previous
From: Rahul Yadav
Date:
Subject: Re: BUG #19599: RestoreBlockImage: the decode cross-checks never bound hole_offset + hole_length against BLCKSZ
Next
From: Ashutosh Sharma
Date:
Subject: Re: Persist slot invalidations before publishing them