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

From: ikedamsh <ikedamsh(at)oss(dot)nttdata(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Richard Guo <guofenglinux(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Assertion failure in smgr.c when using pg_prewarm with partitioned tables
Date: 2025-05-26 07:55:33
Message-ID: 1cf7a731-024b-4421-8f09-b67b5c25df93@email.android.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

<div dir='auto'><div><div><div class="elided-text">2025/05/21 12:54 Fujii Masao &lt;masao(dot)fujii(at)gmail(dot)com&gt;:<br type="attribution"><blockquote style="margin:0 0 0 0.8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">On Mon, May 19, 2025 at 5:18 PM Masahiro Ikeda &lt;ikedamsh(at)oss(dot)nttdata(dot)com&gt; wrote:
<br>
&gt;
<br>
&gt; Thanks for your work and feedback!
<br>
&gt;
<br>
&gt; I've updated the patches and added regular regression tests for
<br>
&gt; both pg_prewarm and amcheck.
<br>

<br>
Thanks for updating the patches!
<br>

<br>
Regarding the 0001 patch:
<br>

<br>
+CREATE TABLE test_part1 PARTITION OF test FOR VALUES FROM (1) TO (1000);
<br>
+INSERT INTO test SELECT generate_series(1, 100);
<br>

<br>
These lines don't seem necessary for the test. How about removing them?
<br>
It would simplify the test and slightly reduce the execution time - though
<br>
the time savings are very minimal.
<br>

<br>
+-- To specify the relation which does not have storage should fail.
<br>

<br>
This comment could be clearer as:
<br>
"pg_prewarm() should fail if the target relation has no storage."
<br>

<br>
+ /* Check that the storage exists. */
<br>

<br>
Maybe rephrase to:
<br>
"Check that the relation has storage." ?<br></p></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">Thanks! I will fix them.</div><div dir="auto"><br></div><div dir="auto"><div><div class="elided-text"><blockquote style="margin:0 0 0 0.8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">
Regarding the 0002 patch:
<br>

<br>
- errdetail("Relation \"%s\" is a %s index.",
<br>
-&nbsp;&nbsp;&nbsp; RelationGetRelationName(rel), NameStr(((Form_pg_am)
<br>
GETSTRUCT(amtuprel))-&gt;amname))));
<br>
+ errdetail("Relation \"%s\" is a %s %sindex.",
<br>
+&nbsp;&nbsp;&nbsp; RelationGetRelationName(rel), NameStr(((Form_pg_am)
<br>
GETSTRUCT(amtuprel))-&gt;amname),
<br>
+&nbsp;&nbsp;&nbsp; (rel-&gt;rd_rel-&gt;relkind == RELKIND_PARTITIONED_INDEX) ?
<br>
"partitioned " : "")));
<br>

<br>
Instead of manually building the message, how about using
<br>
errdetail_relkind_not_supported()?
<br>
It would be more consistent with similar error reporting elsewhere.</p></blockquote></div></div></div><div dir="auto">I was thinking of using errdetail_relkind_not_supported(),</div><div dir="auto">but I’m reconsidering building the message manually</div><div dir="auto">since the AM name seems to be important for the error.</div><div dir="auto">What do you think?</div><div dir="auto"><br></div><div dir="auto">Regards,</div><div dir="auto">--</div><div dir="auto">Masahiro Ikeda</div><div dir="auto"><br></div><div dir="auto"><div><br></div></div></div>

Attachment Content-Type Size
unknown_filename text/html 2.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2025-05-26 08:29:42 Re: Random subscription 021_twophase test failure on kestrel
Previous Message Bertrand Drouvot 2025-05-26 07:49:34 Add AioUringCompletion in wait_event_names.txt and a safeguard in generate-wait_event_types.pl