Page MenuHomePhabricator

Make ParserCache more like a ring
Closed, ResolvedPublic

Description

To reduce the burden of maintenance in ParserCache, we can try to make it more like a ring (More on system design and concept of ring). This also would improve utilization of our spare databases that are currently sitting idle.

Here is the rough idea:

  • Make sure the sharding of page entries is fixed (currently it requires the options + the actual entry). So removal of a 1 in 4 shards triggers 50% drop in capacity. This should be fixed regardless.
  • Improve graceful degradation
  • Force MW to write the PC entry to the second one in the line of hashings as well (in 50% of the times at random, later with further expansion we can bump it to 100%). That basically means entries will get replicated to the other pc clusters. not needed
  • Move all the spare hosts to the ring (as pc6 and pc7).
  • When there is a need to reboot or do something or a host crashes, just remove the whole cluster from the ring.

It's not 100% like rings in NoSQL setups but it is quite similar and helps a lot here.

Details

Related Changes in Gerrit:

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Mentioned in SAL (#wikimedia-operations) [2024-11-25T07:56:08Z] <arnaudb@cumin1002> START - Cookbook sre.hosts.downtime for 7 days, 0:00:00 on pc1013.eqiad.wmnet with reason: T373037, host is not pooled

Mentioned in SAL (#wikimedia-operations) [2024-11-25T07:56:21Z] <arnaudb@cumin1002> END (PASS) - Cookbook sre.hosts.downtime (exit_code=0) for 7 days, 0:00:00 on pc1013.eqiad.wmnet with reason: T373037, host is not pooled

Change #1093956 merged by jenkins-bot:

[operations/mediawiki-config@master] Bump ratio of new parsercache key spec to 6

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

Mentioned in SAL (#wikimedia-operations) [2024-11-25T09:13:56Z] <ladsgroup@deploy2002> Started scap sync-world: Backport for [[gerrit:1093956|Bump ratio of new parsercache key spec to 6 (T373037)]]

Mentioned in SAL (#wikimedia-operations) [2024-11-25T09:18:14Z] <ladsgroup@deploy2002> ladsgroup: Backport for [[gerrit:1093956|Bump ratio of new parsercache key spec to 6 (T373037)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-11-25T09:25:02Z] <ladsgroup@deploy2002> Finished scap sync-world: Backport for [[gerrit:1093956|Bump ratio of new parsercache key spec to 6 (T373037)]] (duration: 11m 05s)

Change #1098006 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[operations/mediawiki-config@master] Bump ratio of new parsercache key spec to 4

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

Change #1098006 merged by jenkins-bot:

[operations/mediawiki-config@master] Bump ratio of new parsercache key spec to 4

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

Mentioned in SAL (#wikimedia-operations) [2024-11-26T11:55:07Z] <ladsgroup@deploy2002> Started scap sync-world: Backport for [[gerrit:1098006|Bump ratio of new parsercache key spec to 4 (T373037)]]

Mentioned in SAL (#wikimedia-operations) [2024-11-26T12:01:58Z] <ladsgroup@deploy2002> ladsgroup: Backport for [[gerrit:1098006|Bump ratio of new parsercache key spec to 4 (T373037)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-11-26T12:10:29Z] <ladsgroup@deploy2002> Finished scap sync-world: Backport for [[gerrit:1098006|Bump ratio of new parsercache key spec to 4 (T373037)]] (duration: 15m 21s)

Change #1098484 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[operations/mediawiki-config@master] Bump ratio of new parsercache key spec to 3

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

Change #1098484 merged by jenkins-bot:

[operations/mediawiki-config@master] Bump ratio of new parsercache key spec to 3

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

Mentioned in SAL (#wikimedia-operations) [2024-11-27T11:32:20Z] <ladsgroup@deploy2002> Started scap sync-world: Backport for [[gerrit:1098484|Bump ratio of new parsercache key spec to 3 (T373037)]]

Mentioned in SAL (#wikimedia-operations) [2024-11-27T11:38:11Z] <ladsgroup@deploy2002> ladsgroup: Backport for [[gerrit:1098484|Bump ratio of new parsercache key spec to 3 (T373037)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-11-27T11:45:11Z] <ladsgroup@deploy2002> Finished scap sync-world: Backport for [[gerrit:1098484|Bump ratio of new parsercache key spec to 3 (T373037)]] (duration: 12m 51s)

Change #1098914 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[operations/mediawiki-config@master] Bump ratio of new parsercache key spec to 2

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

Change #1098914 merged by jenkins-bot:

[operations/mediawiki-config@master] Bump ratio of new parsercache key spec to 2

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

Mentioned in SAL (#wikimedia-operations) [2024-11-28T11:51:57Z] <ladsgroup@deploy2002> Started scap sync-world: Backport for [[gerrit:1098914|Bump ratio of new parsercache key spec to 2 (T373037)]]

Mentioned in SAL (#wikimedia-operations) [2024-11-28T11:57:12Z] <ladsgroup@deploy2002> ladsgroup: Backport for [[gerrit:1098914|Bump ratio of new parsercache key spec to 2 (T373037)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-11-28T12:04:35Z] <ladsgroup@deploy2002> Finished scap sync-world: Backport for [[gerrit:1098914|Bump ratio of new parsercache key spec to 2 (T373037)]] (duration: 12m 37s)

Mentioned in SAL (#wikimedia-operations) [2024-12-02T08:00:18Z] <arnaudb@cumin1002> START - Cookbook sre.hosts.downtime for 7 days, 0:00:00 on pc1013.eqiad.wmnet with reason: T373037, host is not pooled

Mentioned in SAL (#wikimedia-operations) [2024-12-02T08:00:31Z] <arnaudb@cumin1002> END (PASS) - Cookbook sre.hosts.downtime (exit_code=0) for 7 days, 0:00:00 on pc1013.eqiad.wmnet with reason: T373037, host is not pooled

Change #1099653 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[operations/mediawiki-config@master] Enable new ParserCache key schema on every page

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

Change #1099653 merged by jenkins-bot:

[operations/mediawiki-config@master] Enable new ParserCache key schema on every page

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

Mentioned in SAL (#wikimedia-operations) [2024-12-02T10:26:43Z] <ladsgroup@deploy2002> Started scap sync-world: Backport for [[gerrit:1099653|Enable new ParserCache key schema on every page (T373037)]]

Mentioned in SAL (#wikimedia-operations) [2024-12-02T10:33:22Z] <ladsgroup@deploy2002> ladsgroup: Backport for [[gerrit:1099653|Enable new ParserCache key schema on every page (T373037)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-12-02T10:44:09Z] <ladsgroup@deploy2002> Finished scap sync-world: Backport for [[gerrit:1099653|Enable new ParserCache key schema on every page (T373037)]] (duration: 17m 25s)

Change #1099830 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[mediawiki/core@master] ParserCache: Get rid of the temporary key schema ratio config

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

Change #1099830 merged by jenkins-bot:

[mediawiki/core@master] ParserCache: Get rid of the temporary key schema ratio config

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

Change #1101205 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[mediawiki/core@master] objectcache: Automatically fallback to the second db in line

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

I realized since x2 is also uses SqlBagOStuff, this change above will make it much easier to re-architecture x2 to two sections (x2 and x4 for example, we can go with other letter too) and one would automatically failover to the other in case one goes down. We can get rid of the two (currently idle) replicas of x2 in each dc. Just move one to be the other section. And move the remaining one to pc or another section in need. i.e. we also turn x2 into something like parsercache but only two sections. Does this sound reasonable to you @Marostegui ?

Change #1108141 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[operations/mediawiki-config@master] ParserCache: Set connect and recieve timeouts

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

I realized since x2 is also uses SqlBagOStuff, this change above will make it much easier to re-architecture x2 to two sections (x2 and x4 for example, we can go with other letter too) and one would automatically failover to the other in case one goes down. We can get rid of the two (currently idle) replicas of x2 in each dc. Just move one to be the other section. And move the remaining one to pc or another section in need. i.e. we also turn x2 into something like parsercache but only two sections. Does this sound reasonable to you @Marostegui ?

So x2 would become two sections (say x2 and x4) with one host per DC each?

Yup. Similar to parsercache.

That sounds good to me then.

Change #1108141 merged by jenkins-bot:

[operations/mediawiki-config@master] ParserCache: Set connect and recieve timeouts

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

Mentioned in SAL (#wikimedia-operations) [2025-01-06T12:40:55Z] <ladsgroup@deploy2002> Started scap sync-world: Backport for [[gerrit:1108141|ParserCache: Set connect and recieve timeouts (T378076 T373037)]]

Mentioned in SAL (#wikimedia-operations) [2025-01-06T12:46:34Z] <ladsgroup@deploy2002> ladsgroup: Backport for [[gerrit:1108141|ParserCache: Set connect and recieve timeouts (T378076 T373037)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2025-01-06T12:54:34Z] <ladsgroup@deploy2002> Finished scap sync-world: Backport for [[gerrit:1108141|ParserCache: Set connect and recieve timeouts (T378076 T373037)]] (duration: 13m 39s)

Change #1108794 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[operations/mediawiki-config@master] Fully depool ParserCache section if load of the primary is zero

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

Change #1101205 merged by jenkins-bot:

[mediawiki/core@master] objectcache: Automatically fallback to the second db in line

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

Change #1108794 merged by jenkins-bot:

[operations/mediawiki-config@master] Fully depool ParserCache section if load of the primary is zero

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

Mentioned in SAL (#wikimedia-operations) [2025-01-08T13:03:34Z] <ladsgroup@deploy2002> Started scap sync-world: Backport for [[gerrit:1108794|Fully depool ParserCache section if load of the primary is zero (T373037 T383137)]]

Mentioned in SAL (#wikimedia-operations) [2025-01-08T13:12:07Z] <ladsgroup@deploy2002> ladsgroup: Backport for [[gerrit:1108794|Fully depool ParserCache section if load of the primary is zero (T373037 T383137)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2025-01-08T13:22:54Z] <ladsgroup@deploy2002> Finished scap sync-world: Backport for [[gerrit:1108794|Fully depool ParserCache section if load of the primary is zero (T373037 T383137)]] (duration: 19m 19s)

Mentioned in SAL (#wikimedia-operations) [2025-01-08T13:25:06Z] <ladsgroup@cumin1002> dbctl commit (dc=all): 'Depooling pc5 in eqiad for test (T373037)', diff saved to https://phabricator.wikimedia.org/P71867 and previous config saved to /var/cache/conftool/dbconfig/20250108-132506-ladsgroup.json

Mentioned in SAL (#wikimedia-operations) [2025-01-08T13:27:08Z] <ladsgroup@cumin1002> dbctl commit (dc=all): 'Depooling pc5 in codfw for test (T373037)', diff saved to https://phabricator.wikimedia.org/P71868 and previous config saved to /var/cache/conftool/dbconfig/20250108-132708-ladsgroup.json

Ladsgroup updated the task description. (Show Details)

Mentioned in SAL (#wikimedia-operations) [2025-01-08T14:48:06Z] <ladsgroup@cumin1002> dbctl commit (dc=all): 'Repool pc5 (T373037)', diff saved to https://phabricator.wikimedia.org/P71881 and previous config saved to /var/cache/conftool/dbconfig/20250108-144805-ladsgroup.json

Change #1127894 had a related patch set uploaded (by Hashar; author: Hashar):

[operations/mediawiki-config@master] Remove obsolete $wgParserCacheNewKeySchemaRatio

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

Change #1127894 merged by jenkins-bot:

[operations/mediawiki-config@master] Remove obsolete $wgParserCacheNewKeySchemaRatio

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

Mentioned in SAL (#wikimedia-operations) [2025-03-17T11:06:07Z] <dreamyjazz@deploy2002> Started scap sync-world: Backport for [[gerrit:1128375|Re-enable the 'temporary-account-viewer' group for migration (T387205)]], [[gerrit:1127894|Remove obsolete $wgParserCacheNewKeySchemaRatio (T373037)]]

Mentioned in SAL (#wikimedia-operations) [2025-03-17T11:10:25Z] <dreamyjazz@deploy2002> dreamyjazz, hashar: Backport for [[gerrit:1128375|Re-enable the 'temporary-account-viewer' group for migration (T387205)]], [[gerrit:1127894|Remove obsolete $wgParserCacheNewKeySchemaRatio (T373037)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2025-03-17T11:18:40Z] <dreamyjazz@deploy2002> Finished scap sync-world: Backport for [[gerrit:1128375|Re-enable the 'temporary-account-viewer' group for migration (T387205)]], [[gerrit:1127894|Remove obsolete $wgParserCacheNewKeySchemaRatio (T373037)]] (duration: 12m 32s)