Manual:$wgAPIMaxLagThreshold

Details
Maximum amount of DB lag on a majority of DB replica DBs to tolerate before forcing bots to retry any write requests via API errors. This should be lower than the 'max lag' value in $wgLBFactoryConf.