From 4922173010f102a7d56af7c97bd303b95b3f6eff Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Mon, 16 Oct 2023 13:45:39 +0900 Subject: [PATCH] worker_spi: Fix test failure with BGWORKER_BYPASS_ROLELOGINCHECK This is a consequence of 4817da51f69a that has bumped up max_worker_processes, where now the last worker started by the test would be able to start by itself a parallel worker because there are more slots available. This did not show up before as the number of bgworkers reached exactly 8, as known as the previous limit, at the end of the test. Per report from buildfarm member crake, reproducible with debug_parallel_query = regress in the same fashion as fd4d93d269c0. --- src/test/modules/worker_spi/worker_spi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/modules/worker_spi/worker_spi.c b/src/test/modules/worker_spi/worker_spi.c index c26ffe1766..1348181216 100644 --- a/src/test/modules/worker_spi/worker_spi.c +++ b/src/test/modules/worker_spi/worker_spi.c @@ -174,11 +174,11 @@ worker_spi_main(Datum main_arg) worker_spi_role, flags); /* - * Disable parallel query for workers started with BYPASS_ALLOWCONN so as - * these don't attempt connections to the database that may not allow - * that. + * Disable parallel query for workers started with BYPASS_ALLOWCONN or + * BGWORKER_BYPASS_ALLOWCONN so as these don't attempt connections using a + * database or a role that may not allow that. */ - if (flags & BGWORKER_BYPASS_ALLOWCONN) + if ((flags & (BGWORKER_BYPASS_ALLOWCONN | BGWORKER_BYPASS_ROLELOGINCHECK))) SetConfigOption("max_parallel_workers_per_gather", "0", PGC_USERSET, PGC_S_OVERRIDE);