data_checksums + debug_discard_caches = crash

Started by Mihail Nikalayeu20 days ago4 messageshackers
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

won't retrysuccessCI history

This thread has been committed, so CI has stopped here. Anything below is the last result it produced.

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t253302
psql -h localhost -U postgres

Built from patchset v1 (message #1), August 04, 2026 at 12:01 AM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t253302_1 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t253302_1 && git checkout t253302_1

Patchset v1 (message #1) is on t253302_1

Jump to latest
#1Mihail Nikalayeu
mihailnikalayeu@gmail.com

Hello, everyone and Daniel!

While working on some stress suite I found the issue related to way
ProcessSingleRelationByOid access rel->rd_smgr.

Patch with fix and test is attached (it is self-explanatory and pretty simple).

Best regards,
Mikhail.

Attachments:

t253302_1
v1-0001-Do-not-hold-rd_smgr-across-the-fork-loop-when-ena.patchapplication/octet-stream; name=v1-0001-Do-not-hold-rd_smgr-across-the-fork-loop-when-ena.patchDownload+51-3
#2cca5507
cca5507@qq.com
In reply to: Mihail Nikalayeu (#1)
Re: data_checksums + debug_discard_caches = crash

While working on some stress suite I found the issue related to way
ProcessSingleRelationByOid access rel->rd_smgr.

Patch with fix and test is attached (it is self-explanatory and pretty simple).

Good catch! I verify that the bug exists and your patch fixes it. Patch LGTM!

--
Regards,
ChangAo Chen

#3Fujii Masao
masao.fujii@gmail.com
In reply to: cca5507 (#2)
Re: data_checksums + debug_discard_caches = crash

On Tue, Aug 4, 2026 at 12:22 PM cca5507 <cca5507@qq.com> wrote:

While working on some stress suite I found the issue related to way
ProcessSingleRelationByOid access rel->rd_smgr.

Patch with fix and test is attached (it is self-explanatory and pretty simple).

Good catch! I verify that the bug exists and your patch fixes it. Patch LGTM!

+1

The code change looks good to me.

Is the new test really necessary? It only covers this specific data-checksums
worker path, while debug_discard_caches can make the test time longer.

Regards,

--
Fujii Masao

#4Daniel Gustafsson
daniel@yesql.se
In reply to: Fujii Masao (#3)
Re: data_checksums + debug_discard_caches = crash

On 4 Aug 2026, at 05:47, Fujii Masao <masao.fujii@gmail.com> wrote:

On Tue, Aug 4, 2026 at 12:22 PM cca5507 <cca5507@qq.com> wrote:

While working on some stress suite I found the issue related to way
ProcessSingleRelationByOid access rel->rd_smgr.

Patch with fix and test is attached (it is self-explanatory and pretty simple).

Good catch! I verify that the bug exists and your patch fixes it. Patch LGTM!

+1

The code change looks good to me.

Agreed, thanks for the report and patch!

Is the new test really necessary? It only covers this specific data-checksums
worker path, while debug_discard_caches can make the test time longer.

While useful for verifying the issue, I don't think we need to add this test
due to the increased test timing and the fairly low probability of it catching
anything now that the code is fixed.

Will push and backpatch to 19.

--
Daniel Gustafsson