Lucas_Werkmeister_WMDE added a comment.
There seems to be some confusion at the moment about whose responsibility it is to ensure terms are unused when they’re cleaned. The `TermStoreCleaner` interface says: > Delete the given term in lang IDs. > Ensuring that they are unreferenced is the caller’s responsibility. But the `DatabaseUsageCheckingTermStoreCleaner` implementation does: > Checks the provided TermInLangIds for existence and usage in either > on both Items and Properties. > > Those that do actually exist and are unused are passed to an inner cleaner. $unusedTermInLangIds = $this->findActuallyUnusedTermInLangIds( $termInLangIds, $dbw ); $this->innerCleaner->cleanTermInLangIds( $dbw, $dbr, $unusedTermInLangIds ); I think the “it’s the caller’s responsibility” was the original design, but then Split new term storage cleaning into own transaction <https://gerrit.wikimedia.org/r/570996> happened (T244115 <https://phabricator.wikimedia.org/T244115>, cc @Addshore) and now the cleaner has to check for unused terms as well. We should check how the interface is currently used; if all callers now rely on the cleaner checking for usage, then it’s probably best to update the interface documentation (and the `InMemoryTermStore` implementation) while leaving the `DatabaseUsageCheckingTermStoreCleaner` unchanged. TASK DETAIL https://phabricator.wikimedia.org/T270247 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Lucas_Werkmeister_WMDE Cc: Lucas_Werkmeister_WMDE, Aklapper, Addshore, MisterSynergy, noarave, Akuckartz, Iflorez, alaa_wmde, Nandana, lucamauri, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, _jensen, rosalieper, Scott_WUaS, Jonas, Wikidata-bugs, aude, Lydia_Pintscher, Mbch331
_______________________________________________ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs