Page MenuHomePhabricator

Support cookie-driven fractional migration to PHP 8.1 deployments of mw-web and mw-api-ext
Closed, ResolvedPublic

Description

Once the "next" deployments of these services take shape (T377040) we'll need to add support for progressively routing external traffic to them.

There are two parts to this:

  1. We will need to develop an ATS Lua plugin script for remapping the "main" deployment target (e.g., mw-web, mw-web-ro) to the respective "next" target (e.g., mw-web-next, mw-web-next-ro) depending on the presence / value of the cookie.
  2. We will need to revive support for consistent fractional cookie enrollment via the WikimediaEvents extension (see e.g. [0] previously used in the migration to 7.4).

One important aspect to #1 is also supporting a "load fraction" that routing to "next" is predicated upon in addition to the cookie. This allows us to incrementally shift traffic back to "main" once it's fully updated to 8.1 during the final phase of the migration, in a way that's independent of migration cookie state (aside: we could also use this in a similar way in the very unlikely event of an emergency where we need to shunt back to 7.4 in a semi-controlled way).

[0] https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/WikimediaEvents/+/refs/heads/master/modules/ext.wikimediaEvents/phpEngine.js

Related Objects

StatusSubtypeAssignedTask
OpenNone
StalledNone
OpenNone
StalledNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
StalledNone
StalledNone
OpenNone
OpenNone
StalledNone
In ProgressKrinkle
ResolvedScott_French
ResolvedScott_French
ResolvedScott_French
Resolveddduvall
ResolvedScott_French
ResolvedScott_French
ResolvedKrinkle

Event Timeline

Change #1072821 had a related patch set uploaded (by Scott French; author: Scott French):

[operations/puppet@production] trafficserver: Lua script for routing 8.1-enrolled traffic

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

It appears that the phpEngine instrument is still fully wired into the WikimediaEvents extension - i.e., it seems no work will be necessary on that end of things.

In order to make use of it, we'll need to add the relevant wiring to mediawiki-config to set WMENewPHPVersion and WMENewPHPSamplingRate.

Change #1080388 had a related patch set uploaded (by Scott French; author: Scott French):

[operations/mediawiki-config@master] Add variables for incremental enrollment in PHP 8.1

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

Change #1082581 had a related patch set uploaded (by Scott French; author: Scott French):

[operations/puppet@production] trafficserver: add mw-php-migration to mapping_rules

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

The support for fractional enrollment via WikimediaEvents has now been validated by @Krinkle in T377987. Meaning, we should be good to go once the pending patches tagged on this task are merged.

Change #1072821 merged by Scott French:

[operations/puppet@production] trafficserver: Lua script for routing 8.1-enrolled traffic

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

Change #1101104 had a related patch set uploaded (by Scott French; author: Scott French):

[operations/puppet@production] trafficserver: validate production config in tests

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

Change #1101104 merged by Scott French:

[operations/puppet@production] trafficserver: validate production config in tests

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

Change #1082581 merged by Scott French:

[operations/puppet@production] trafficserver: add mw-php-migration to mapping_rules

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

Mentioned in SAL (#wikimedia-operations) [2025-01-21T18:49:34Z] <swfrench-wmf> finished running puppet on A:cp-text for ATS mapping change - T377042

Alas, the first couple of logs were missed while stashbot was absent from -operations:

18:02:44 <swfrench-wmf> !log disabling puppet on A:cp-text ahead of ATS mapping change - T377042
18:19:53 <swfrench-wmf> !log validated routing behavior on cp4040 (applied at 18:10 UTC) - T377042
18:23:38 <swfrench-wmf> !log started incrementally running puppet on A:cp-text for ATS mapping change - T377042

All in all, no issues encountered.

Change #1080388 merged by jenkins-bot:

[operations/mediawiki-config@master] Add variables for incremental enrollment in PHP 8.1

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

Mentioned in SAL (#wikimedia-operations) [2025-01-22T18:03:47Z] <swfrench@deploy2002> Started scap sync-world: Backport for [[gerrit:1080388|Add variables for incremental enrollment in PHP 8.1 (T377042)]]

Mentioned in SAL (#wikimedia-operations) [2025-01-22T18:08:32Z] <swfrench@deploy2002> swfrench: Backport for [[gerrit:1080388|Add variables for incremental enrollment in PHP 8.1 (T377042)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2025-01-22T18:15:41Z] <swfrench-wmf> verified PHP_ENGINE / PHP_ENGINE_STICKY enrollment behavior in mwdebug - T377042

Mentioned in SAL (#wikimedia-operations) [2025-01-22T18:25:51Z] <swfrench@deploy2002> Finished scap sync-world: Backport for [[gerrit:1080388|Add variables for incremental enrollment in PHP 8.1 (T377042)]] (duration: 22m 03s)

In mwdebug and then subsequently after wider deployment, I was able to verify that:

  1. In the absence of PHP_ENGINE_STICKY, the PHP_ENGINE cookie is removed (as expected, while wgWMENewPHPSamplingRate is zero).
  2. With PHP_ENGINE_STICKY set, it's left intact.

Together with the ATS mapping changes, I believe that's all for this task. Next steps will be tracked in T383845 (traffic ramp).