Re: Bug: mdunlinkfiletag unlinks mainfork seg.0 instead of indicated fork+segment

solai v <solai.cdac@gmail.com>

From: solai v <solai.cdac@gmail.com>
To: surya poondla <suryapoondla4@gmail.com>
Cc: Matthias van de Meent <boekewurm+postgres@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Robert Haas <robertmhaas@gmail.com>, Dilip Kumar <dilipbalaut@gmail.com>
Date: 2026-05-17T14:50:50Z
Lists: pgsql-hackers
Hi Matthias,

I reviewed the v2 patch and tested it on my local build.

I verified that before the patch, mdunlinkfiletag() ignored forknum
and segno and always operated on MAIN_FORKNUM segment 0.
The new direction with register_unlink_tombstone() makes the intent
much clearer, and the added Assert() looks like a good safeguard
against accidental misuse.

I also had a small comment suggestion near the Assert() to make the
tombstone-only behavior slightly more explicit.
The patch applied successfully with git apply --3way, and PostgreSQL
built and tested successfully on my setup.

Overall the patch looks good to me.

Regards,
Solai