In T377042: Support cookie-driven fractional migration to PHP 8.1 deployments of mw-web and mw-api-ext, we configured the WikimediaEvents extension [0] for incremental enrollment of client session in PHP 8.1 via the PHP_ENGINE cookie and added an ATS Lua script to support selection of the -next services when PHP_ENGINE=8.1.
The purpose of this task is to:
- Clean up the 8.1-migration-specific configuration in InitialiseSettings.php (i.e., WikimediaEvents stops actively managing the cookie).
- Remove the now-latent Lua script [1] from the relevant plugin chains in [2].
- Figure out how we want to abstract the Lua script to more generically support -next routing, either for future PHP migrations or other use cases.
The solution we've gone with initially has the following properties:
- Routing remains cookie-based, but supports an arbitrary cookie pattern for identification of eligible requests. The pattern is defined in the config table file (cookie_pattern), rather than in the script.
- The config table now supports an enabled entry which, if false, causes the script to immediately return TS_LUA_REMAP_NO_REMAP on entry, without inspecting the request further. This makes it far cheaper to leave the script in the relevant plugin chains.
- There are no changes to the load_fraction config table entry (i.e., as before, it is a random selection probability applied to eligible requests).
[0] https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/WikimediaEvents/+/refs/heads/master/modules/ext.wikimediaEvents/phpEngine.js
[1] https://gerrit.wikimedia.org/r/plugins/gitiles/operations/puppet/+/refs/heads/production/modules/profile/files/trafficserver/mw-php-migration.lua
[2] https://gerrit.wikimedia.org/g/operations/puppet/+/refs/heads/production/hieradata/common/profile/trafficserver/backend.yaml