Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wAAlZ-0028GZ-38 for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Apr 2026 18:03:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wAAlY-001oNx-1Y for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Apr 2026 18:03:08 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wAAlY-001oNp-0G for pgsql-hackers@lists.postgresql.org; Tue, 07 Apr 2026 18:03:08 +0000 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wAAlW-000000014qn-2cbg for pgsql-hackers@postgresql.org; Tue, 07 Apr 2026 18:03:07 +0000 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-66c4c7e2bb7so7177178a12.0 for ; Tue, 07 Apr 2026 11:03:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775584984; cv=none; d=google.com; s=arc-20240605; b=VUfzv0ASO6n+vpNR6mgBt53P4NvQwT0IPxrn3k8DyfrdCbVIUh6AK7+BV2aSAB39e6 nZyAebZpOq1y5roWbdGU0b45LSxY8TjI8r3BKXryGl+HgBenbER1mXJkemsxK6reqftB 978MxwDd8LuUZgIlVsBNaIUD9OKTnt5f46m09daMdgmXrmer4jkMyIkNhYMZwgC6w7Jy aEh0//2U8MyeT/7CSHErmfSzKg/i/3QqaiSC/ICuj8JnZoD7nsqxLXki76UngWIBPiXz WREcrltwfvom5rD4xC9cHbe8zw0N3IUYx3rLZi25BYtcKCeyaFBtygCWCfWKtr7rweqo ivqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=tSUWVKQBPeGzEk37bjaDV1MilhkK0VbSFFkFg0yYkaw=; fh=dHfmrJXvsbwQzwczGd+YpXCIzScDL57lWhbrxJ16Z/g=; b=UV8AE7fXOOKNwnxanC2q0mmOhv8c6Ct7CK9zgGPKphCxKfEY1wY3DqfMbNcSNwmcUG LgT53XLWIBe/SV+NVQMhg6ZxBRbxqZb+sg/1HS8gQMRk/42PPKAtej/9uwnvfKikq/Hu s/5QeZw2u0LPKnUJ0jQHErW7XYrYpsvGJJOQlsVvvoOu8reWBpPsYNv3Gn2AV3Haull9 SjtmSA4J+KnrqvpUV6T1RYDYtQX7BO2Q+lgzMBi0mR4wlq2EbcW9NcWLP9n11y+1sCA5 ZUcWvx8zw1nmneQFJ5DrB6DlD+ByW+O7jqKA4aZ6BhQeImDp7HvxaBNjsdrTYILirKnn 1EGw==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775584984; x=1776189784; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=tSUWVKQBPeGzEk37bjaDV1MilhkK0VbSFFkFg0yYkaw=; b=ANlqR7S3JnQC/sl/8hMtUA+Z7e7yF0a4QtNbLYXoPBIHQ5bqaw862r0cJ0Ov9dCDVU 8joHIUAbmZFKlLtFR/OFuzqi/Kchs6/tuWhSvzLRRQyNLUaQv5I3vlMpRGYgmMEVns2f +CTYuAAAN5G9frTqMvGu0o/MEDzoNRnPhQkjq+ROK40RKp555WnDitbDvMZT2SneYJtj lqIhoXifdM8D4pAlhvC5QuBbzjSDnr6kMsE9Mzu7X1cOqVzwM4TMk6Tpb7xoy3rR2+28 u/HHFIGIbQVoFuMTPE0ydbbGiGIBq/t3axclGm5qP2P1bgv5WAR3vqUTovBzpsMjrTvL veFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775584984; x=1776189784; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=tSUWVKQBPeGzEk37bjaDV1MilhkK0VbSFFkFg0yYkaw=; b=ox6o5CImz4d9WNJC/r811BCnqP53Y/358LX28yGtgGpN6/CER+tZ0n/9YUS0gAluZG xPc+d0lNdUcAitnGvuYoRsHcH2V5V+IzcP3Sd9GaDu8k/suGv27qbQWoPGOkuDZCt2GN Yt/9YUFEacDHhnXmpKHSfrtzuKMvOoo/wAQw8fCtB01JqHV/S9uq92PvUeyXGqnwvfRV IIdpGcacRhYMebpHahhzGd+SIr1B6MiSnEs9GA27F859LbDDRsT+icd/Adfbc95+mNqr l4gTCjkRm+7dF+k9LF1/2P8N/G2HhZHBKfvhm71VX1qQghJXBnTvztmlhreO5DAb8w4e hQIg== X-Forwarded-Encrypted: i=1; AJvYcCUSJqyxuW0w4Jwepg1vlR4J26X4K1fgJ80S18pjiPzEzW4nbK0TdmPeHowrRhIODfHCIfu3KIq/VbnLshjQ@postgresql.org X-Gm-Message-State: AOJu0Ywea03LxWW8ORzrNVBtxlh9jcGM4Ju5W4bpbWzoZSmG9C9f/t58 0AHJp19PE8x6ogfzYutkarNDdnLIfEBvDcJwQL0p/9gvvR484CXqbffbGxMW2L85lZ/vBsTiKws sfUenRJ60i/0U+TvIPU5C1IOVjv40OPaz6PVr X-Gm-Gg: AeBDiet8P+2wieAEf09mw0Xy/zgYEIuspRBsAszgsyqqygJytpX5J0m2i6buoeRad57 Jxz1naYLhb5dZlDJkt9BGBq1tjFsHzkA4HwP3pc84jQVzeZU25/PObgbjUx4seOWN6cZyxLOP6q WNrcOdTD7Lo4SBI0DX6YhwpeufOeijupp5uiZwXsRz05ehS25ZPYndgfEqePvROZLTdqK9j2TCR ZhEUDaAYc49GVMA8xDFBhc7EQhix5HIUwrRJ5d4UNS25nWnZTOWtyNPr6ukOkxfcQ3Tm8xrD2SK GQRvXQ== X-Received: by 2002:a17:907:25c3:b0:b9c:4a6c:7dc5 with SMTP id a640c23a62f3a-b9c674454damr893131366b.5.1775584983318; Tue, 07 Apr 2026 11:03:03 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Sami Imseih Date: Tue, 7 Apr 2026 13:02:49 -0500 X-Gm-Features: AQROBzCKkO7QXJLFKlneTfQN0VCX0pzgorA16aF2bT1mhByTSw7EWgJ7iC2qL7Y Message-ID: Subject: Re: test_autovacuum/001_parallel_autovacuum is broken To: Daniil Davydov <3danissimo@gmail.com> Cc: Masahiko Sawada , pgsql-hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Tue, Apr 7, 2026 at 11:33=E2=80=AFPM Sami Imseih = wrote: > > > > > The proposed patch fixes the problem, but I am thinking about possibl= e new > > > tests for parallel a/v. What if some of them will require both inject= ion points > > > and wait_for_autovacuum_complete call? > > > > Yeah, we could use dynamically named injection points, which I don't > > see a precedent for. For example, we could construct a name like > > "autovacuum-test-" and have the autovacuum code path > > generate the injection point name dynamically based on the relation > > being vacuumed. That way, the test only blocks on the specific table > > it cares about. > > > > I am afraid that this would be too rough a workaround for this problem.. Perhaps, but I don't see it being unreasonable for injection points. I guess we can also think about expanding InjectionPointCondition to handle other types of conditions, maybe OID??, to filter when running the point. /* * Conditions related to injection points. This tracks in shared memory the * runtime conditions under which an injection point is allowed to run, * stored as private_data when an injection point is attached, and passed as * argument to the callback. * * If more types of runtime conditions need to be tracked, this structure * should be expanded. */ typedef enum InjectionPointConditionType { INJ_CONDITION_ALWAYS =3D 0, /* always run */ INJ_CONDITION_PID, /* PID restriction */ } InjectionPointConditionType; typedef struct InjectionPointCondition { /* Type of the condition */ InjectionPointConditionType type; /* ID of the process where the injection point is allowed to run */ int pid; } InjectionPointCondition; > We also have an "autovacuum_parallel_workers" reloption that can addition= ally > limit the number of parallel workers for the table. Default value of the > reloption is "-1" which means "use the GUC parameter's value". I.e. when = we are > setting the GUC parameter to N, then every table automatically allows N > parallel a/v workers. If autovacuum_max_parallel_workers =3D 0 then no on= e can > launch parallel workers for autovacuum, even if reloption is > 0. Thus, > autovacuum_max_parallel_workers is the main limiter during the number of > parallel workers calculation. autovacuum_max_parallel_workers being the limiter is a desirable attribute, otherwise it will allow users to disable the GUC and set whatever they want on a per table level, only guarded by max_parallel_workers. That to me sounds pretty easy to misconfigure and manage. > But I suggest an alternative idea - allow reloption to override GUC param= eter. > So even if autovacuum_max_parallel_workers is 0 we still can enable paral= lel > a/v for a particular table via reloption. > > This approach allows us to rework the test as follows : > 1) Keep the default value of GUC parameter which means that no table allo= ws > parallel a/v. > 2) Set reloption of a particular table to N (allow parallel a/v for this = and > only this table). > > This approach may also be very useful in large productions. You can read > discussion about it from here [1] up to the end of the thread. Since the > question is still open, all feedback is welcome! > > [1] https://www.postgresql.org/message-id/CAJDiXgj3A%3DwNC-S0z3TixmnVUkif= s%3D07yLLHJ7_%2BdDsakft1tA%40mail.gmail.com Thanks! -- Sami