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 1wwMHL-001w62-1n for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Aug 2026 16:03:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wwMHJ-00GY30-0d for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Aug 2026 16:03:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wwMHI-00GY2r-2k for pgsql-hackers@lists.postgresql.org; Tue, 18 Aug 2026 16:03:06 +0000 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wwMHH-00000001QR6-0D6U for pgsql-hackers@postgresql.org; Tue, 18 Aug 2026 16:03:05 +0000 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-c15f020a223so687011566b.1 for ; Tue, 18 Aug 2026 09:03:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=planetscale.com; s=google; t=1787068982; x=1787673782; darn=postgresql.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=gd6PvWTQEoMXos8cZSHag1yt6WSuJYXECDbCWiwrgNw=; b=ccX3V+ThbPo68TmpJxm22mJMUDtTemxLs+w6WsvovhDizSsSjH1BX4hILyZ0bvyPDv gEV9RE93Fr8rl0Sg9mG4+7TyOpJe35NACuxt4mDLY2VVXU/8URIX3T5Hr5lQu3pbxOCV tzbCWlinOgPD7tW9tns0dcgjf/wF1/UEi7+HujcU11UZjth3cR5Wwv3rpQ1O8Ri2uNuG tQEjMmKpRrpyo4LHgmdY804cVH9RLzBNKPUTLfUY+FIzfzrgI9/ClMAziVjxfCWAzORH /nViIw7n81JNSPRhIU4xjze63A9RW65S5BGWJnc+3J/k12xTrv2vgW433DbEF1JD9+vk JlVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787068982; x=1787673782; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=gd6PvWTQEoMXos8cZSHag1yt6WSuJYXECDbCWiwrgNw=; b=lZIA2zjSFEocJa5YKiTQ3UqFjsMGaW9Dgb0puUdN4I4Qrn6U0nBBPxkE5D9hOksVmk 9ElFq1AeecQSHGiFWtfUz/g8QtlNohYSFe2HknSR4YJurxpoc8r4aJb4uk+QUABBwUoR 6TQukB7/0R3j+WA2pSRGbj7GqQtV/2fmu7T/1A/ta+H7O/EXiR/rkz1koZlukFVo2ifB Th9lY12qYUHr5d9EbwiC+ovqlO5n2nl/ftwmdyw9EhacyOlgsvlIzl0ttNj613lV7PzM Pa0GncJ+ymzcwKgoje9MyhDbk3HeFiR4m7cF2jxwwHj7zcbEPIsOlBuU8ab72dFlxirh tezA== X-Gm-Message-State: AOJu0Yy+Na0PWmEdy8DpjsSk71W/Amz/1QzIlaJ/ap62xq67mqamIuHL PBUorsQ6oIZEI7jx8ilvx8XC63Mujxwtwzve96nx/ignDynd5NxL2kgcXv+rnr+3lJU+Dev04Hb 1Zbos8sQ= X-Gm-Gg: AR+sD13PYsNrZ819/hLAYQ4DycuAAOA9FxvvD1yN6g903P6C5wKuMCcMwoHvHYYjbdz 0tiUJIp40vDtkZ2u4x0SkJxMF+gkkq2uKxpbj9iUP7CrOaIU0YqUyWkEAq0AXCrCYwn2qpoUttN ywhVfsQ3NQsZmuTYuVBsep9RnCZqB61i1cGu/cthoqzXS4IkJfFznCHhzXQAOA1a9c1lcBb456f RPN38Yv5+tS415U5tIvMkCa0Adz2/VkPido4Mtolnwnqu6MkpKvbfRorSqzUrqvlmK8NEde1my3 fX1IbRxmgF8xy65ST4l9M86vahtLT2PKbVhz2ZaPtRSwpZ9m74/7QorullDlQpuV7oTgREgIrIR UVO+o7eUgfQJDMikf0K+qV0RRJEARAFVJbsTzY7Er8j4neXiTcBv8ch2RN3M34jn6g85EF5USU1 dya6/K5kg4T54VzMRsWwMf88yzO3kvGrRhmToiYCqZuQBjuC26XQmtz7+MFLbJXbRaBOt6esdWd +uxXLGe8amtXBvi/aYjBaVVZ9tWoQUm8j4/9vWr3wOSOB8XEiGF7zl60w== X-Received: by 2002:a05:6938:a081:20b0:c16:12ff:dc93 with SMTP id a640c23a62f3a-c21885d0e18mr455404066b.18.1787068982274; Tue, 18 Aug 2026 09:03:02 -0700 (PDT) Received: from ?IPV6:2a04:4540:6523:2c00:717e:bbd:efe2:daa4? ([2a04:4540:6523:2c00:717e:bbd:efe2:daa4]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c217fed68f9sm212419566b.27.2026.08.18.09.03.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 18 Aug 2026 09:03:01 -0700 (PDT) Message-ID: <29ff18e1-7cbb-4e64-b75c-4ea35d21a82a@planetscale.com> Date: Tue, 18 Aug 2026 18:03:01 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Add tests for src/backend/nodes/extensible.c To: Aleksander Alekseev , Rafia Sabih Cc: PostgreSQL Development References: Content-Language: en-GB From: Jan Nidzwetzki In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 05.08.26 13:40, Aleksander Alekseev wrote: >>>> Currently extensible.c is not covered by any tests. The proposed >>>> patch fixes this. [...] > Thanks! Fixed. Thanks for working on this. I have applied the v3 version of the patch on my system (gcc 14, --buildtype debug, cassert on) and checked the coverage. In my test, the test coverage for src/backend/nodes/extensible.c increased from 0% to 94.29%. My notes from reading the patch: - Other tests in src/test/modules contain a .gitignore file. This patch does not include one. - test_get_extensible_node_methods() and test_get_custom_scan_methods() are not marked as STRICT and passing a NULL argument crashes the backend (both call PG_GETARG_TEXT_PP(0) unconditionally). In contrast, test_ext_node_callbacks() is already STRICT, so this looks like an oversight. A possible enhancement: The comment in _PG_init() justifies the shared_preload_libraries requirement by saying that parallel workers read the plan back with stringToNode(). That is true in principle, but the CustomPath is never marked parallel safe, so no Gather is ever built and the path is never taken: nodeOut() and nodeRead() are reached only via test_ext_node_callbacks(), but never through the executor. I did a few experiments, and with the following modifications, I was able to create such a plan: I changed: -+- rel = table_open(tnode->relid, NoLock); [...] table_close(rel, NoLock); -+- to -+- rel = table_open(tnode->relid, AccessShareLock); [...] table_close(rel, AccessShareLock); -+- Afterward, I could adjust test_set_rel_pathlist() and set: -+- cpath->path.parallel_safe = true; -+- Now, the following query gives the desired test coverage: -+- SET debug_parallel_query = regress; SELECT id, val FROM test_extensible_tbl ORDER BY id; RESET debug_parallel_query; -+- With 'debug_parallel_query = on', the query uses the following query plan: -+- jan=# SET debug_parallel_query = on; SET jan=# EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF) SELECT id, val FROM test_extensible_tbl ORDER BY id; QUERY PLAN ---------------------------------------------------------------------- Gather (actual rows=6.00 loops=1) Workers Planned: 1 Workers Launched: 1 Single Copy: true Buffers: shared hit=38 -> Sort (actual rows=6.00 loops=1) Sort Key: id Buffers: shared hit=38 Worker 0: Sort Method: quicksort Memory: 25kB -> Custom Scan (TestCustomScan) on test_extensible_tbl [...] Buffers: shared hit=1 Planning Time: 0.140 ms Execution Time: 12.729 ms (13 rows) -+- Best regards Jan -- Jan Nidzwetzki PlanetScale Postgres Core Team