Re: 回复: [PATCH] BUG FIX: Core dump could happen when VACUUM FULL in standalone mode

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Yulin PEI <ypeiae(at)connect(dot)ust(dot)hk>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: 回复: [PATCH] BUG FIX: Core dump could happen when VACUUM FULL in standalone mode
Date: 2020-11-30 18:54:47
Message-ID: 1276532.1606762487@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Yulin PEI <ypeiae(at)connect(dot)ust(dot)hk> writes:
> Yes, I agree because (IsNormalProcessingMode() ) means that current process is not in bootstrap mode and postmaster process will not build index.
> So my new modified patch is attached.

This is a good catch, but the proposed fix still seems pretty random
and unlike how it's done elsewhere. It seems to me that since
index_build() is relying on plan_create_index_workers() to assess
parallel safety, that's where to check IsUnderPostmaster. Moreover,
the existing code in compute_parallel_vacuum_workers (which gets
this right) associates the IsUnderPostmaster check with the initial
check on max_parallel_maintenance_workers. So I think that the
right fix is to adopt the compute_parallel_vacuum_workers coding
in plan_create_index_workers, and thereby create a model for future
uses of max_parallel_maintenance_workers to follow.

regards, tom lane

Attachment Content-Type Size
avoid-parallel-index-build-in-standalone-mode.patch text/x-diff 677 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-11-30 19:03:46 Re: [PATCH] remove deprecated v8.2 containment operators
Previous Message Anastasia Lubennikova 2020-11-30 18:51:12 Re: [PATCH] remove deprecated v8.2 containment operators