Page MenuHomePhabricator

WikibaseQualityConstraints can’t cache constraint results in federated setups
Open, Needs TriagePublic


If the WBQualityConstraintsCacheCheckConstraintsResults config is true (which is the default), WikibaseQualityConstraints will cache constraint check results. For this, it needs to know the latest revision ID of all referenced entities, so that the results can be invalidated if those entities are edited. However, it does this using a metadata lookup that only supports local entities:

$wikiPageEntityMetaDataAccessor = $repo->getLocalRepoWikiPageMetaDataAccessor();

This is incorrect and causes constraint checks to crash when running on a wiki with federated entities (e. g. (Beta) Commons) – see T244572#5864108 for a stack trace.

Either the service wiring needs to recognize when some entity types aren’t local, and disable caching in that case (because getLocalRepoWikiPageMetaDataAccessor() can’t be used), or WikibaseRepo needs to offer some WikiPageEntityMetaDataAccessor that works for all entity types.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 10 2020, 12:03 PM

Change 571271 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Don’t cache results with non-local sources

Change 571271 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Don’t cache results with non-local sources