From: Yura Sokolov <y.sokolov@postgrespro.ru>
To: pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>
To: Thomas Munro <tmunro@postgresql.org>
To: Heikki Linnakangas <hlinnaka@iki.fi>
To: Michael Paquier <michael@paquier.xyz>
To: Robert Haas <robertmhaas@gmail.com>
Subject: Bug in v13 due to "Fix corruption when relation truncation fails."
Date: Thu, 26 Dec 2024 13:10:59 +0300
Message-ID: <f98aaa79-80b5-47c9-832a-31416a3a528b@postgrespro.ru> (raw)
Good day.
Commit "Fix corruption when relation truncation fails." [0] makes
smgrtruncate be called in a critical section. Unfortunately in version
13 it leads to occasional call to palloc0 inside of critical section,
which triggers Assert in debug builds:
- smgrtruncate calls mdtruncate
- mdtruncate may call register_dirty_segment
- register_dirty_segment calls RegisterSyncRequest
- RegisterSyncRequest calls ForwardSyncRequest
- ForwardSyncRequest may call CompactCheckpointerRequestQueue
- CompactCheckpointerRequestQueue may call palloc0 ...
In versions 14 and above CompactCheckpointerRequestQueue does check for
critical section due to commit "Fix bugs in MultiXact truncation" [1],
which were backported down to 14 version, but not 13.
We caught it in our private tests, so it is real.
Cherry-pick of [1] from 14 version to 13 solves the issue.
[0] https://git.postgresql.org/gitweb/?p=postgresql.git;h=2280912165d
[1] https://git.postgresql.org/gitweb/?p=postgresql.git;h=4c8e00ae9ae
------
regards,
Yura Sokolov aka funny-falcon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: y.sokolov@postgrespro.ru, pgsql-hackers@lists.postgresql.org, tmunro@postgresql.org, hlinnaka@iki.fi, michael@paquier.xyz, robertmhaas@gmail.com
Subject: Re: Bug in v13 due to "Fix corruption when relation truncation fails."
In-Reply-To: <f98aaa79-80b5-47c9-832a-31416a3a528b@postgrespro.ru>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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