[PATCH] Remove unused PageIsPredicateLocked()
Hi,
The proposed patch removes dead code in src/backend/storage/lmgr/predicate.c
If my understanding is correct, PageIsPredicateLocked() was added in
dafaa3efb75 (Feb 2011) but its call was removed in 47ad79122bc (Mar
2011) and we have never used it since. It was mentioned in one recent
discussion [1]/messages/by-id/CA+COZaBo+ZpKgMvxcdACUjNtdYipe9Em06iX5KHLTVaTmFibiw@mail.gmail.com but it was pointed out that it can't be used there
either.
If anyone believes that we should keep it alternatively we could cover
it with tests or at least add an Assert() somewhere.
[1]: /messages/by-id/CA+COZaBo+ZpKgMvxcdACUjNtdYipe9Em06iX5KHLTVaTmFibiw@mail.gmail.com
--
Best regards,
Aleksander Alekseev
On Wed, 16 Sept 2026 at 15:23, Aleksander Alekseev
<aleksander@tigerdata.com> wrote:
Hi,
The proposed patch removes dead code in src/backend/storage/lmgr/predicate.c
If my understanding is correct, PageIsPredicateLocked() was added in
dafaa3efb75 (Feb 2011) but its call was removed in 47ad79122bc (Mar
2011) and we have never used it since. It was mentioned in one recent
discussion [1] but it was pointed out that it can't be used there
either.If anyone believes that we should keep it alternatively we could cover
it with tests or at least add an Assert() somewhere.
I'm fine with removing it, for reasons including because its signature
promise wasn't ever truly clear.
-Matthias
The following review has been posted through the commitfest application:
make installcheck-world: tested, passed
Implements feature: tested, passed
Spec compliant: not tested
Documentation: not tested
Hello,
This patch looks good to me using master commit e73841ffbceea314cf9fa3f64a5eae9f87a46449.
doxygen.postgresql.org shows no reference for this routine.
Searching this routine in whole source code returns no match.
There is neither need to check SQL compliance not to update documentation.
Regards,
PF.
The new status of this patch is: Ready for Committer
Hi all,
On Tue, Sep 22, 2026 at 10:28 AM Aleksander Alekseev
<aleksander@tigerdata.com> wrote:
Hi,
The proposed patch removes dead code in src/backend/storage/lmgr/predicate.c
If my understanding is correct, PageIsPredicateLocked() was added in
dafaa3efb75 (Feb 2011) but its call was removed in 47ad79122bc (Mar
2011) and we have never used it since. It was mentioned in one recent
discussion [1] but it was pointed out that it can't be used there
either.If anyone believes that we should keep it alternatively we could cover
it with tests or at least add an Assert() somewhere.[1]: /messages/by-id/CA+COZaBo+ZpKgMvxcdACUjNtdYipe9Em06iX5KHLTVaTmFibiw@mail.gmail.com
--
Thank you for the patch. I tested the patch and verified that the
changes are limited to removing the function implementation and its
declaration. I also find this to be a relevant cleanup and have
confirmed that no references to PageIsPredicateLocked() remain in the
source tree. Then I ran make check-world and git diff --check, which
passed successfully without any issues. There are no functional issues
with the patch and it looks good to me.
Regards,
Solai
On Tue, Sep 22, 2026 at 5:54 PM solai v <solai.cdac@gmail.com> wrote:
There are no functional issues
with the patch and it looks good to me.
The patch looks good to me as well. Barring any objections, I will
commit it.
Regards,
--
Fujii Masao
On Thu, Oct 22, 2026 at 9:44 PM Fujii Masao <masao.fujii@gmail.com> wrote:
On Tue, Sep 22, 2026 at 5:54 PM solai v <solai.cdac@gmail.com> wrote:
There are no functional issues
with the patch and it looks good to me.The patch looks good to me as well. Barring any objections, I will
commit it.
BTW, while removing PageIsPredicateLocked(), I found that the
"INTERFACE ROUTINES" comment in predicate.c is outdated. For example,
it lists RegisterPredicateLockingXid(void), although the function takes
a TransactionId, and omits functions such as
CheckForSerializableConflictOutNeeded() and ShareSerializableXact().
Rather than updating the list, isn't it better to remove it? The declarations
are already available in the headers predicate.h, and maintaining
a duplicate list seems likely to result in further omissions and
outdated signatures.
Thought?
Regards,
--
Fujii Masao
Attachments:
nocfbot-0002-Remove-the-redundant-interface-list-and-fix-funct.patchapplication/octet-stream; name=nocfbot-0002-Remove-the-redundant-interface-list-and-fix-funct.patchDownload+2-43
Hi,
Thanks for the attention to the patch.
The patch looks good to me as well. Barring any objections, I will
commit it.BTW, while removing PageIsPredicateLocked(), I found that the
"INTERFACE ROUTINES" comment in predicate.c is outdated. For example,
it lists RegisterPredicateLockingXid(void), although the function takes
a TransactionId, and omits functions such as
CheckForSerializableConflictOutNeeded() and ShareSerializableXact().Rather than updating the list, isn't it better to remove it? The declarations
are already available in the headers predicate.h, and maintaining
a duplicate list seems likely to result in further omissions and
outdated signatures.Thought?
Sounds good to me.
--
Best regards,
Aleksander Alekseev