Page MenuHomePhabricator

Use a consistent caching strategy within Revision storage classes
Closed, ResolvedPublic

Description

While investigating the parts for T198701 we realized that the caching around Revision storage is quite inconsistent.

Currently the different types of cache keys used within Revision storage related classes are quite different

ClassType of KeyUses Domain ID?Uses Wiki Id?Result
RevisionStoremakeGlobalKeyyesnoCache entries are shared between all wikis and divided by domain / wiki being accessed
NameTableStoremakeKeynoyesThere is a separate cache per site and this is divided by wiki id being accessed
SqlBlobStoremakeKeynonoThere is a separate cache per site, and this is not divided up by wiki being accessed at all. (Only wikiid = false access is cached)

Note: wiki id can also be false, so entries cached using wikiId instead of DomainID have to use makeKey to ensure we don't screw up the cache

Possible actions:

  • SqlBlobStore should cache access to blobs for remote wikis. In order to do this the cache key should include the wikiid
  • NameTableStore & SqlBlobStore should share the same cache between all sites. makeGlobalKey should be used and an identifier of the site should be included in the cache key (for example DomainID)

Event Timeline

I'm going for option two, which is already used by RevisionStore: "NameTableStore & SqlBlobStore should share the same cache between all sites. makeGlobalKey should be used and an identifier of the site should be included in the cache key (for example DomainID)".

Change 443646 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/core@master] Use consistent caching strategy in Revision storage classes

https://gerrit.wikimedia.org/r/443646

Change 443653 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/core@master] Introduce makeCrossWikiKey().

https://gerrit.wikimedia.org/r/443653

Change 443653 abandoned by Daniel Kinzler:
Introduce makeCrossWikiKey().

Reason:
per aaron

https://gerrit.wikimedia.org/r/443653

Change 443646 merged by jenkins-bot:
[mediawiki/core@master] Use consistent caching strategy in Revision storage classes

https://gerrit.wikimedia.org/r/443646

Change 450049 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/core@master] Document cross-wiki cache sharing logic.

https://gerrit.wikimedia.org/r/450049

Change 450049 merged by jenkins-bot:
[mediawiki/core@master] Document cross-wiki cache sharing logic.

https://gerrit.wikimedia.org/r/450049