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 1wAADM-0027UN-35 for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Apr 2026 17:27:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wAADK-001gl5-1C for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Apr 2026 17:27:46 +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 <3danissimo@gmail.com>) id 1wAADJ-001gkw-2w for pgsql-hackers@lists.postgresql.org; Tue, 07 Apr 2026 17:27:46 +0000 Received: from mail-yx1-xb136.google.com ([2607:f8b0:4864:20::b136]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from <3danissimo@gmail.com>) id 1wAADI-000000014UX-0fQ1 for pgsql-hackers@postgresql.org; Tue, 07 Apr 2026 17:27:45 +0000 Received: by mail-yx1-xb136.google.com with SMTP id 956f58d0204a3-6500eae6d2fso5351267d50.1 for ; Tue, 07 Apr 2026 10:27:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775582863; cv=none; d=google.com; s=arc-20240605; b=CKqRmQfp9tyHxsZ+fW3TE15z22e9MeoTykhgwpPiYMbIdx/ZFEcMm5/D2xsKvycCYu MNmWxNmwR7DbRauOEV/5Uc+f5zwzCrL67nUaL2AaReDcUxx+aZJf2M+WWN1nArRCGQD+ lWg/mCqaEELQ61engGesUwb4jwFmmds/jdpCODAJCYWSyeOVPg+AQakXMFjb7aNowNHR y2zgLOuHT2puWBDymun3BofzvTnSHlkIDWUMRszkBk3C60iuLq50r7yMQM7tFTaFpgKc /VNrroG3n1u6t2B84BIPOMBnMl40QuQ4xZ/y+Mch2xyrpbeNohtLtCzjAFiEVVJSaDOM h3cw== 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=TJqWCydVtmNeOQxOvihYE0oHboW0W2ze6A3iTTPC0rg=; fh=zwZz10v0uv6nSrYioKmOTNf9zS/NTlJIpK3PhzNZi9M=; b=FXtl45QnJ+cDCcOxqAwTyEzdCabSAPSt4qCk4k/UdcRdtAzbJ0Za+4LR7Ewc44dFDR Zyctk2nu3wDEsbfIk9xFvCKGGwBKl5srnZF0FyqGGESKzj69ZqYMr4zOULunaGPEyFl0 jsdbpNh/ivI8zHfTBq/ljZljWQIVDUQVQRib2KjS3SSlhU9B+wf5cD8OyVfL/WtdvKaA ipDcLIWHFAAXrj9Z2qo+y2bDyf3U0ihyZWgcqA9X4riKxQpSmyddQ0xkjtTtp1vAjI/r 6SaTsZ8gq/3TzAliXnNUqP1QDOC5MWS5nZn8/IvSoW4Pr9LFL+zU1CBhWLjmmY7zZ26C zaSA==; 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=1775582863; x=1776187663; 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=TJqWCydVtmNeOQxOvihYE0oHboW0W2ze6A3iTTPC0rg=; b=kPhQ+eRXoPL+CD8CWKRU3fJKXD6DzyPlY90QHp9u/Kqx3cunSgLYBMvB1WQHxMDNdK gjeQT4dTZyFbT5QewAQI3/xRNhU1rx4evJHE+Rt+t5hQh63r2BkQfHUWwNpm5GdIdfdB qwPEyDINHerQFjWbJLj2RjgK2LhO98unpr750Yn2/BfZ5pg3TIsezwzZ9MZ3ETCoqfaH WOZMoYHG48OmDRHaDtPvwjYptnLMHp2AGXBXJPm46ATrKEBQAqfIlwszNyIcQh2TNw0X /+8ri9jxjIbuRf4tLS8sVnPdrmboBqXpgH9pIxtvQ82C3eeDLWFMys2Uh/3/+NwQI2fQ pQxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775582863; x=1776187663; 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=TJqWCydVtmNeOQxOvihYE0oHboW0W2ze6A3iTTPC0rg=; b=DmGaT4meLVobAeHzdKZE+bwI0fQH3q7fkZ57MMxO36faC1ronndRYLSZq18TWBGgq7 PMNlJk7lvdN39Ol3bnLLO8xPIfGIJiLcBJ/Wu8QSwnWJjJJDvt7M8j3Z+Vw+pEZdkCMK AYUUOhpO1h/GtVTSojr0DtLhliXWmF2FlNzND6qsMJXbiO0C9YU2DX9xWhNri9OUOTxg xgADKM38VfrYkaxxJdnGho5tiYMkVD95veCQ3agodAmFoPYVvNCiB40jQtX9hMAQHtK5 4z2OuA8w2q0BWWzELNunXFEstAG9HlIBxqV+rTaycGK78/V4yuxjyX0njXYIWmgjGw/c 5AWQ== X-Forwarded-Encrypted: i=1; AJvYcCU7tGUGEe+FR428+OL1H/oWeTVy6QAyvh7o3gRmwQMjd8ufymHnTo2kWaRA7Qk35kS//s7HihnuXzowZNeV@postgresql.org X-Gm-Message-State: AOJu0YzYYlc5OhbcNQ1bppz+bSehREZc+EDy0ZnaP/F+glX89HoSipDo 1pR1u8itt8D/X1Gkat1/wV4rx31zNxPFiZ9R8V44glN78ZJLVjai4aO/HbmY2w8SkyBsw0Mh3RD xD4H1px/XrausyYv47snv3hxLfazgPK0= X-Gm-Gg: AeBDies6VypHBOqe6uELzOQDuoO9HLrbNjYS3wdb9McinyhbSs792e5U4NaWQAzuVeE XSM2R++aI6I4RD/C1LR2O/XAj76rQSTESJ7ep0oWumypvnW+jM3KabSLnliarKwg0Lgc5tkiMNt 5jcFZSqBaBXcdKdg9jXcJfWAk8tLyNW9hO25Cw/WESVb++tYbESA9Qq/v19dPFy9QQ00oyDJg9x XPAFmFRqPsw5dTUKHzd45pJt7smUHSAhK9h3xKxD+OgQDaftRd4S3AXCphVXwBeBZzbHsA3yyuF L1+gB67+ X-Received: by 2002:a05:690e:158d:10b0:650:37e7:e59f with SMTP id 956f58d0204a3-6504880f170mr13687296d50.37.1775582863452; Tue, 07 Apr 2026 10:27:43 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Daniil Davydov <3danissimo@gmail.com> Date: Wed, 8 Apr 2026 00:27:32 +0700 X-Gm-Features: AQROBzBIEdswcLq9crEt_TmlVxYXfqyDHc9Yr3qkqT3BfOKaC2NTGfgo02vSEQo Message-ID: Subject: Re: test_autovacuum/001_parallel_autovacuum is broken To: Sami Imseih 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 Hi, On Tue, Apr 7, 2026 at 11:33=E2=80=AFPM Sami Imseih w= rote: > > > The proposed patch fixes the problem, but I am thinking about possible = new > > tests for parallel a/v. What if some of them will require both injectio= n 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.. > But I don't think we need to do this now, since the test we are dealing > with does not need to wait for autovacuum to complete. Sure! But this test needs to be slightly reworked in the future. > > If the reloption could override the GUC > > parameter, then we could disable parallel a/v globally and turn it on f= or the > > particular table. In this case we can avoid such a problem. > > That is an interesting idea which may be possible since we do reserve > a/v workers at startup with autovacuum_worker_slots. Although I am > not sure if we should be putting a feature that makes disabling > autovacuum globally supported behavior. Hm, I think I didn't reveal my thoughts enough. Let me describe current logic in short : each a/v worker now can take from bgworkers pool as many parallel workers as the GUC parameter (autovacuum_max_parallel_workers) allows. We also have an "autovacuum_parallel_workers" reloption that can additional= ly 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 one = 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. But I suggest an alternative idea - allow reloption to override GUC paramet= er. So even if autovacuum_max_parallel_workers is 0 we still can enable paralle= l 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 allows parallel a/v. 2) Set reloption of a particular table to N (allow parallel a/v for this an= d 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-S0z3TixmnVUkifs%= 3D07yLLHJ7_%2BdDsakft1tA%40mail.gmail.com -- Best regards, Daniil Davydov