Steps to re-produce:
1) Use MediaWiki docker - https://www.mediawiki.org/wiki/MediaWiki-Docker
2) Follow the steps in https://www.mediawiki.org/wiki/MediaWiki-Docker/Configuration_recipes/Alternative_databases before running `docker compose up -d`
# Make an edit using Chrome with Network tab open.
# Right click on the REST API call and copy the request as "fetch".
# Make an edit using a non-chrome browser (such as Firefox).
# Open a terminal for the "mariadb-replica" container
# Login to mysql using the user `root` and the password `main_root_password`
# Run the following:
```lang=sql
STOP SLAVE;
CHANGE MASTER TO MASTER_DELAY=3600;
START SLAVE;
```
6) Load http://localhost:8080/w/api.php?action=query&format=json&meta=siteinfo&formatversion=2&siprop=dbrepllag
7) Check that "lag" is set to "3600". If it is, then your replica is lagged by 60 minutes.
8) Open the console for Firefox
9) Paste the "fetch" command and modify the end of the URL to use the revision ID for the edit made in the Firefox browser
To finish, follow the following commands:
# Open a terminal for the "mariadb-replica" container
# Login to mysql using the user `root` and the password `main_root_password`
# Run the following:
```lang=sql
STOP SLAVE;
CHANGE MASTER TO MASTER_DELAY=0;
START SLAVE;
```
4) Load http://localhost:8080/w/api.php?action=query&format=json&meta=siteinfo&formatversion=2&siprop=dbrepllag
5) Check that "lag" is set to "0". If it is, then your replica is no longer lagged.
Because the check for existing Client Hints data rows is done on a replica DB, if this replica DB is lagged enough the replica DB could report no such Client Hints row. This means that the UserAgentClientHintsManager will attempt to insert with rows that would violate the unique constraint via the index `uach_name_value`. This will normally cause the insert query to fail. However, there may be rows that need inserting.
Adding the `IGNORE` option to the insert query should address the issue by ignoring rows that violate the unique constraint on combinations of `uach_name` and `uach_value`.