Page MenuHomePhabricator

Translate extension should not automatically switch to querying master in all non-GET requests
Open, HighPublic

Description

Currently Translate extension has a utility method called shouldReadFromPrimary() which returns true if the request was posted or there is a write or it's a maintenance script. This is a major scalability bottleneck and anti-pattern (we can buy more replicas, we can't buy more masters). It basically means a lot of read queries happen on the master when it doesn't really need to and it should be explicitly set to read from primary only when it really needs the freshest data and even with that we have flush replicas, we have chronology protector, we have wait for replication methods.

This is potentially contributing to the issues caused on commons database T370304: Bursts of occasional severe contention on s4 (commonswiki) primary mariadb causing recurrent user-facing outages on all wikis and is showing up in large set of selects on the primary of s4.