Assertion failure in smgr.c when using pg_prewarm with partitioned tables

From: Masahiro Ikeda <ikedamsh(at)oss(dot)nttdata(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Assertion failure in smgr.c when using pg_prewarm with partitioned tables
Date: 2025-05-15 08:52:06
Message-ID: e082e6027610fd0a4091ae6d033aa117@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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:

$ pgbench -i -s 1 --partitions=3
$ psql <<EOF
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?

Regards,
--
Masahiro Ikeda
NTT DATA CORPORATION

Attachment Content-Type Size
v1-0001-Fix-assertion-failure-when-pg_prewarm-is-used-on-.patch text/x-diff 2.6 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Guo 2025-05-15 08:55:08 Re: Assert failure in base_yyparse
Previous Message Jakub Wartak 2025-05-15 07:57:01 xlogrecovery.c:WaitForWALToBecomeAvailable() - make "switched WAL source" visible by default?