pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix assertion failure in pg_prewarm() on objects without storage
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix assertion failure in pg_prewarm() on objects without storage
@ 2025-05-29 08:53 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Fujii Masao @ 2025-05-29 08:53 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix assertion failure in pg_prewarm() on objects without storage.

An assertion test added in commit 049ef33 could fail when pg_prewarm()
was called on objects without storage, such as partitioned tables.
This resulted in the following failure in assert-enabled builds:

    Failed Assert("RelFileNumberIsValid(rlocator.relNumber)")

Note that, in non-assert builds, pg_prewarm() just failed with an error
in that case, so there was no ill effect in practice.

This commit fixes the issue by having pg_prewarm() raise an error early
if the specified object has no storage. This approach is similar to
the fix in commit 4623d7144 for pg_freespacemap.

Back-patched to v17, where the issue was introduced.

Author: Masahiro Ikeda <ikedamsh@oss.nttdata.com>
Reviewed-by: Dilip Kumar <dilipbalaut@gmail.com>
Reviewed-by: Richard Guo <guofenglinux@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/e082e6027610fd0a4091ae6d033aa117@oss.nttdata.com
Backpatch-through: 17

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3c4d7557e03ba1ca988a2d1a2518a4ad93976f86

Modified Files
--------------
contrib/pg_prewarm/Makefile                |  2 ++
contrib/pg_prewarm/expected/pg_prewarm.out | 10 ++++++++++
contrib/pg_prewarm/meson.build             |  5 +++++
contrib/pg_prewarm/pg_prewarm.c            |  8 ++++++++
contrib/pg_prewarm/sql/pg_prewarm.sql      | 10 ++++++++++
5 files changed, 35 insertions(+)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Fix assertion failure in pg_prewarm() on objects without storage
@ 2025-05-29 08:53 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Fujii Masao @ 2025-05-29 08:53 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix assertion failure in pg_prewarm() on objects without storage.

An assertion test added in commit 049ef33 could fail when pg_prewarm()
was called on objects without storage, such as partitioned tables.
This resulted in the following failure in assert-enabled builds:

    Failed Assert("RelFileNumberIsValid(rlocator.relNumber)")

Note that, in non-assert builds, pg_prewarm() just failed with an error
in that case, so there was no ill effect in practice.

This commit fixes the issue by having pg_prewarm() raise an error early
if the specified object has no storage. This approach is similar to
the fix in commit 4623d7144 for pg_freespacemap.

Back-patched to v17, where the issue was introduced.

Author: Masahiro Ikeda <ikedamsh@oss.nttdata.com>
Reviewed-by: Dilip Kumar <dilipbalaut@gmail.com>
Reviewed-by: Richard Guo <guofenglinux@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/e082e6027610fd0a4091ae6d033aa117@oss.nttdata.com
Backpatch-through: 17

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/b64c585fde77206ee54747f31035dde56eee6bf9

Modified Files
--------------
contrib/pg_prewarm/Makefile                |  2 ++
contrib/pg_prewarm/expected/pg_prewarm.out | 10 ++++++++++
contrib/pg_prewarm/meson.build             |  5 +++++
contrib/pg_prewarm/pg_prewarm.c            |  8 ++++++++
contrib/pg_prewarm/sql/pg_prewarm.sql      | 10 ++++++++++
5 files changed, 35 insertions(+)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2025-05-29 08:53 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-05-29 08:53 pgsql: Fix assertion failure in pg_prewarm() on objects without storage Fujii Masao <fujii@postgresql.org>
2025-05-29 08:53 pgsql: Fix assertion failure in pg_prewarm() on objects without storage Fujii Masao <fujii@postgresql.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox