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.94.2) (envelope-from ) id 1uFV8p-0059Z4-JR for pgsql-hackers@arkaria.postgresql.org; Thu, 15 May 2025 09:44:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uFV8o-00Da2j-2f for pgsql-hackers@arkaria.postgresql.org; Thu, 15 May 2025 09:44:38 +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.94.2) (envelope-from ) id 1uFV8n-00Da2Y-Pg for pgsql-hackers@lists.postgresql.org; Thu, 15 May 2025 09:44:37 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uFV8l-001tvB-0O for pgsql-hackers@lists.postgresql.org; Thu, 15 May 2025 09:44:36 +0000 Received: from [192.168.11.9] (p1696134-ipoe.ipoe.ocn.ne.jp [118.0.93.133]) by oss.nttdata.com (Postfix) with ESMTPSA id A80FA615C3; Thu, 15 May 2025 18:44:30 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at oss.nttdata.com Message-ID: <7fde0acf-2395-44d8-b081-bfa0e10097dc@oss.nttdata.com> Date: Thu, 15 May 2025 18:44:29 +0900 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Assertion failure in smgr.c when using pg_prewarm with partitioned tables To: Dilip Kumar , Masahiro Ikeda Cc: PostgreSQL Hackers References: Content-Language: en-US From: Fujii Masao In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025/05/15 18:20, Dilip Kumar wrote: > On Thu, May 15, 2025 at 2:22 PM Masahiro Ikeda wrote: >> >> Hi, >> >> I encountered an assertion failure when a partitioned table is specified >> as an argument to pg_prewarm. Below are the steps to reproduce the >> issue: Thanks for the report! This assertion failure can also occur when pg_prewarm() is run on objects like foreign tables, plain views, or other relations that don't have storage - not just partitioned tables. >> $ pgbench -i -s 1 --partitions=3 >> $ psql <> CREATE EXTENSION pg_prewarm; >> SELECT pg_prewarm('pgbench_accounts'); >> EOF >> >> The following assertion failure occurs: >> >> TRAP: failed Assert("RelFileNumberIsValid(rlocator.relNumber)"), File: >> "smgr.c", Line: 246, PID: 1246282 >> postgres: ikeda postgres [local] >> SELECT(ExceptionalCondition+0xbb)[0x55edd16725c1] >> postgres: ikeda postgres [local] SELECT(smgropen+0x5e)[0x55edd145c1ff] >> >> >> It looks like this may have been overlooked in commit 049ef33. >> What do you think? > > Yeah, this should be fixed, don't you think that instead of checking > the relnumber is valid, +1 How about adding a check to see whether the target relation has storage, using something like RELKIND_HAS_STORAGE()? Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION