Page MenuHomePhabricator

Provide information about Wikibase caches for external identifiers & formatter property URLs
Closed, ResolvedPublic5 Estimated Story Points

Description

As discussed in last week's documentation coffee meeting:

Users interested in defining links for external identifiers (cf. this doc and this wiki) should be informed about the existence and size/length of the various caches that might prevent their changes from showing up immediately.
Ideally the user should also be informed about how to clear these caches if feasible.

Please provide as much info as possible about these caches so that I can include that information in the relevant documentation.

Possible caches that are involved:

  • parser cache
  • caching of property info (this is not cleared or updated when the setting is enabled)
  • There could be other caches? but these would be the clear ones

General flow is:

  • Create property
  • Use property
  • Configure property
  • Think that things are not working :(

Discussion

do we have a maintenance script to invalidate caches?

Parsercache yes, propertyinfo no

Crosslinking T112081: [Story] purge cached renderings of IDs when the formatter URL changes which could be relevant

Acceptance Criteria:

  • Docs exist for the current situation of formatter url caching complexities & how to deal with them

Event Timeline

Restricted Application added a subscriber: • Aklapper. · View Herald Transcript

There's no "Wikibase" tag any more so I don't know how to tag this properly...

Addshore renamed this task from Provide information about Wikibase caches for external identifiers work to Provide information about Wikibase caches for external identifiers & formatter property URLs.Jul 28 2021, 10:32 AM
Addshore updated the task description. (Show Details)
Addshore set the point value for this task to 5.

So like the mentioned T112081: [Story] purge cached renderings of IDs when the formatter URL changes states there is currently no way to purge these things, however they end up in the shared cache with the sharedCacheKeyGroup as the key (The prefix isn't used here).

This is currently cached quite hard on two layers for both repo/client

First in the WANCache, then on the Local one. The current implementation also does not seem to consider any CACHE_NONE being set but will always cache it, so even setting the cache TTL to something like 0 does not work.

The only reliable way I found to "purge" this cache locally is to set sharedCacheKeyGroup to something new to get a new cache key.

$wgWBRepoSettings['sharedCacheKeyGroup'] = 'newCacheKeyGroup';

This is of course not ideal but the only thing I can come to think of to recommend doing when setting these things up.

Ok, I've found another way to work with these a bit more reliably. (I think originally something got into the WANCache that didn't go away)

  1. Configure the shared cache TTL to be -1 which does not end up getting cached.
$wgWBRepoSettings['sharedCacheType'] = CACHE_NONE;
$wgWBRepoSettings['sharedCacheDuration'] = -1;
  1. Configure property
$wgWBRepoSettings['formatterUrlProperty'] = 'P1';
  1. Create formatter property P1
  2. Create external ID property P2 with formatter property as statement
  3. Create Item that's using P2 and set it's value to something.
  4. Should now render on every page refresh.
  5. (In case it does not this means something is probably already in the WANCache, then changing sharedCacheKeyGroup is the only way to get it out)

Reading "Please provide as much info as possible about these caches so that I can include that information in the relevant documentation."

I'm thinking this means i'm not supposed to write any actual documentation, moving it to peer review.

Ideally the user should also be informed about how to clear these caches if feasible.

I assume it should be possible to purge these caches:

  • purge the WAN cache, e.g. restart memcached (if it caches stuff on disk you’ll need to do some more work here, this will depend on the cache)
  • restart the web server / php-fpm service / etc. to purge the local (ACPu) cache

@danshick-wmde Does this look like useful information to you?

@danshick-wmde Does this look like useful information to you?

Yes, thanks. I was in the process of responding to your comment yesterday but didn't finish. I note that my doc.wikimedia.org TOC link in the description didn't stay stable after a putative doc regen, so I don't remember precisely what it was pointing at. :(

But as for the Advanced Config doc, this info looks helpful.

Specifically, I see:

  • explanations of which caches exist and what they do
  • guidelines for $wgWBRepoSettings['sharedCache...'] settings
  • methods for clearing those caches

Anything I'm missing? Is more info likely to flow in here?

@danshick-wmde Does this look like useful information to you?

Yes, thanks. I was in the process of responding to your comment yesterday but didn't finish. I note that my doc.wikimedia.org TOC link in the description didn't stay stable after a putative doc regen, so I don't remember precisely what it was pointing at. :(

But as for the Advanced Config doc, this info looks helpful.

Specifically, I see:

  • explanations of which caches exist and what they do
  • guidelines for $wgWBRepoSettings['sharedCache...'] settings
  • methods for clearing those caches

Anything I'm missing? Is more info likely to flow in here?

I think that is all what we could come up with!