[PATCH] Remove unused PageIsPredicateLocked()
[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] 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]: http://postgr.es/m/CA%2BCOZaBo%2BZpKgMvxcdACUjNtdYipe9Em06iX5KHLTVaTmFibiw%40mail.gmail.com -- Best regards, Aleksander Alekseev
Re: [PATCH] Remove unused PageIsPredicateLocked()
От:
Matthias van de Meent <boekewurm+postgres@gmail.com>
Дата:
On Wed, 16 Sept 2026 at 15:23, Aleksander Alekseev 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
Re: [PATCH] Remove unused PageIsPredicateLocked()
От:
Pierre Forstmann <pierre.forstmann@gmail.com>
Дата:
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
Re: [PATCH] Remove unused PageIsPredicateLocked()
От:
solai v <solai.cdac@gmail.com>
Дата:
Hi all, On Tue, Sep 22, 2026 at 10:28 AM Aleksander Alekseev 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]: http://postgr.es/m/CA%2BCOZaBo%2BZpKgMvxcdACUjNtdYipe9Em06iX5KHLTVaTmFibiw%40mail.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
Re: [PATCH] Remove unused PageIsPredicateLocked()
От:
Fujii Masao <masao.fujii@gmail.com>
Дата:
On Tue, Sep 22, 2026 at 5:54 PM solai v 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
Re: [PATCH] Remove unused PageIsPredicateLocked()
On Thu, Oct 22, 2026 at 9:44 PM Fujii Masao wrote: > > On Tue, Sep 22, 2026 at 5:54 PM solai v 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
Re: [PATCH] Remove unused PageIsPredicateLocked()
От:
Aleksander Alekseev <aleksander@tigerdata.com>
Дата:
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