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 1wAu5A-000YPQ-0p for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Apr 2026 18:26:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wAu58-007EYY-1s for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Apr 2026 18:26:23 +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 1wAu58-007EYH-0W for pgsql-hackers@lists.postgresql.org; Thu, 09 Apr 2026 18:26:23 +0000 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wAu56-00000000Cnr-3ScJ for pgsql-hackers@postgresql.org; Thu, 09 Apr 2026 18:26:22 +0000 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-35d9f68d011so865911a91.2 for ; Thu, 09 Apr 2026 11:26:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775759180; cv=none; d=google.com; s=arc-20240605; b=WWac9hlWlIAxCU1a0i4xzoxT6SLoNch8p9mwER2XmD+SYo0L3Otlbd5y2J8U5fz4qU qjGcSlAw9NBJxXtjUB63LY+XlcyOC2W9P7Dq8XPX+EGDTUbjKjpUWXcC9l9QsbK0XNWk gL1k+3ejyTpyVv4/UCSUFOGU5mreSxaZod8cX1x8AjHVqwQG+cY6tmsD2JLSZUmp9fLJ LnwD+k7pkWGSoKhzQnnA8fcC0NMxLEtv31d2lC15DI9scHxIjdENNGGnb24g3ssc7scn aINQeE0LrPH+bJwMyT69cfBNXjs5PyfjcfvDzCoC/uEE5uVkjFUtz8yDL3Bue/VUNugW 4YdA== 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=kue889JtTmzbnqeHqkqQwoIBZmQTNfHSstO81dbXINU=; fh=lSm1PLk1dgkOh+wENGVsNqRmPq1MfH6FS2JD7Tr3joA=; b=UlVs1kx4SQdX5mUH9FXooQ8HrVFonSl+UyMypTPrG+KUg8NlDmC0BxaMEdTm1JYv5U P1UdXKdezJjd6ZwJXsNuSApaEf2EF8h1ookVqGGQZM1KcMML4oTgy2DYjbj9YRTzCbT5 lfUPMqTNSnlZyQ0QrQbEIsDA6fgaQBLx5PF2gYf+ut10aeImMeE1IdG6rXCZqsHFZnP9 EkCfkcBfr8NSByvi4YgFsW4NJzXGHr3sY6FXvfguIiOpaXGR+gJk+CqiQY05lwsbXfsj W17RnGtffl2IQRVqQFSqecLBCdjrP2pL6r4jaUx5cYnsZY5G1p1rLDTGyWCmGriZ/4d1 AwYg==; 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=1775759180; x=1776363980; 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=kue889JtTmzbnqeHqkqQwoIBZmQTNfHSstO81dbXINU=; b=PsRsD2s/reluKc+3b0s0mZqq7K+tynQgS6q4fV1ZwRDsBzjhtI8+jW21UfLLrNHZ79 Ch1q3NawN616VbD/ceeBdOFlVymVEfI5lYWVbU2IgfME8RyYllHGAhdo/k/VjcNbX8td B4QXqzvdx16BCASU/7wYOdfLdh2BZ3paY1x0HuHNFMceBtcUuzPWpXPc4nl2wd6HunWB FTU0wC0KHh7u26pzK6BiWlpC9hYwr9tA1SAf/LtTEBho1QPu0p0+8IEK1S74d5MIUMAx w3EMN7IrB/LxWhs8GjNv/p9R31qs+Hf+oLQ51FrdVx4BlN4Drzc4VbVzPFY3TpItflm4 gupg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775759180; x=1776363980; 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=kue889JtTmzbnqeHqkqQwoIBZmQTNfHSstO81dbXINU=; b=cv9g9UdZ4ba++iBbRmOInr9zzvXFyfiURg45u66yqg/VZBRynR53arQrkioHuwQRrE 4aed7oo+Q1OxMB0BPZsWU8OPEqx8z5VU7+59bTzHJzbxrBdzRkYGPxBcZoXsh5seaf0B V12IfUECyEvSwMiRlvgMX8qDTKSPl29XnsN4L1dsRiETf1/CPGQxc2X+Ks9HTxliSJI3 L2cjowSc0ynXn4/degwcdXkspIhSSd4sU4p/Ljp/BRwx1nS51e6MiE4yECn/3LRaaRzE wibo+L3H+o/sannVfa0KWg6ZfCSZekcGOkOLpbZy4PaDdNpbFuQV1bDk0D8q5K+Z0yaI AjpQ== X-Forwarded-Encrypted: i=1; AJvYcCVNbBWKAfCUlVw+fKeaGZpVwQa/t2c+SyrDNdlDj+2TYk4+Bvf9JR9mrgOxb9N3veKLVi/WDSLtf8402RTX@postgresql.org X-Gm-Message-State: AOJu0YxKDM+whqrnGXYidWbO7wiqbRRyH95l6vUSCSxjnuOJ+LIeDyUx 7DS03g9KP6paEEqiqWY5h5r0/vf7MZWQ5W6ri5qr3U40gPw8CnaPYhm9+ZZEZcdS+bHf2JopB8i zCRCNnSJzd2w3ugaKBOCVwVBBnVDVF64= X-Gm-Gg: AeBDieuqUmW60yDYXo8pEZsSTaOQOIvYzMzPezNjKWE8bRCJY2LDv/LdLftlmGT+Ney HY06c6doW8pMPApBZSU6g7rUhLOE0AUpoc7ZQHyaLoR2Q94nnkS01pEve3ZzcZabdsxXF40/IrU LKsz828KmnRroQKNUQii5v8b4CukCaxtSZPl06yRn9coTM9QlhXojBXGEQbHSXzFH8zMn4PLuLp OELPeaJRl52bgb6axab8N6N2Z2nUTS9aJVqgYbN+YwMi/jWvcSji1raCUoOKEjh9YFBVyHaUK2z UvVrNA== X-Received: by 2002:a17:90b:17c9:b0:35d:a87b:ef69 with SMTP id 98e67ed59e1d1-35e4283ddd4mr133992a91.28.1775759180127; Thu, 09 Apr 2026 11:26:20 -0700 (PDT) MIME-Version: 1.0 References: <525d0f48-93f7-493f-a988-f39b460a79bc@gmail.com> In-Reply-To: <525d0f48-93f7-493f-a988-f39b460a79bc@gmail.com> From: Masahiko Sawada Date: Thu, 9 Apr 2026 11:25:41 -0700 X-Gm-Features: AQROBzB590vHawuKlAotETB8dTd6ddogS8YrSlEBAb-HCYJlfX7LulgA53VU3jw Message-ID: Subject: Re: test_autovacuum/001_parallel_autovacuum is broken To: Alexander Lakhin Cc: Sami Imseih , pgsql-hackers , Daniil Davydov <3danissimo@gmail.com> 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 Thu, Apr 9, 2026 at 11:00=E2=80=AFAM Alexander Lakhin wrote: > > Hello, > > 07.04.2026 05:23, Sami Imseih wrote: > > I noticed that the test introduced in parallel autovacuum in 1ff3180ca01 = was > very slow, but eventually succeeded. I tracked it down to the point in > the test that is waiting for "parallel autovacuum worker updated cost par= ams". > > > I've found another issue with the test manifested on buildfarm, at least > at [1]: > [06:54:07.738](4.121s) not ok 1 > [06:54:07.769](0.031s) # Failed test at /home/bf/bf-build/flaviventris/= HEAD/pgsql/src/test/modules/test_autovacuum/t/001_parallel_autovacuum.pl li= ne 133. > ### Stopping node "main" using mode fast > > The corresponding test code: > # Wait until the parallel autovacuum on table is completed. At the same t= ime, > # we check that the required number of parallel workers has been started. > wait_for_autovacuum_complete($node, $av_count); > ok( $node->log_contains( > qr/parallel workers: index vacuum: 2 planned, 2 launched in total= /, > $log_offset)); > > but regress_log_001_parallel_autovacuum contains this string: > 2026-04-07 06:54:07.736 CEST [1825954][autovacuum worker][102/5:0] LOG: = automatic vacuum of table "postgres.public.test_autovac": index scans: 1 > ... > parallel workers: index vacuum: 2 planned, 2 launched in total > > though the timestamp difference is only 2 ms. I tried the following > modification: > @@ -1222,6 +1222,7 @@ heap_vacuum_rel(Relation rel, const VacuumParams *p= arams, > (double) dead_items_max_bytes / (1024 * 102= 4)); > appendStringInfo(&buf, _("system usage: %s"), pg_rusage_show= (&ru0)); > > +pg_usleep(300000); > ereport(verbose ? INFO : LOG, > (errmsg_internal("%s", buf.data))); > pfree(buf.data); > > and it makes the test fail for me on each run. > Could you please look if this can be fixed too? > Thank you for the report. The root cause seems to me that it's not guaranteed that we can see the autovacuum logs after checking the statistics (i.e., pg_stat_user_tables) as we update the statistics and then write the log. One way to fix the test is to replace log_contains() with wait_for_log(). We can also remove wait_for_autovacuum_complete() logic altogether. Regards, --=20 Masahiko Sawada Amazon Web Services: https://aws.amazon.com