fleet/server/datastore
Roberto Dip 8d18e67ab6
prevent errors on tests that use real replicas (#20121)
For #20046, I found this while trying to get #20085 merged, as MySQL 8
tests were consistenly failing (5 times in a row) with this when
integration tests are run in parallel.

I used the `lhotari/action-upterm@v1` action to hook an SSH session into
the worker, and I noticed different errors in different runs, but all on
the same lines of this sample:

```
mysql> SELECT * FROM replication_applier_status_by_worker LIMIT 1 OFFSET 0\G
*************************** 1. row ***************************
                                           CHANNEL_NAME:
                                              WORKER_ID: 1
                                              THREAD_ID: NULL
                                          SERVICE_STATE: OFF
                                      LAST_ERROR_NUMBER: 1146
                                     LAST_ERROR_MESSAGE: Worker 1 failed executing transaction 'ANONYMOUS' at master log bin.000003, end_log_pos 25540153; Error 'Table 'server_datastore_mysql_TestTeams.host_mdm_apple_bootstrap_packages' doesn't exist' on query. Default database: 'server_datastore_mysql_TestTeams'. Query: 'TRUNCATE TABLE host_mdm_apple_bootstrap_packages'
                                   LAST_ERROR_TIMEST
```

This uses

[REPLICATE_DO_DB](https://dev.mysql.com/doc/refman/5.7/en/change-replication-filter.html)
to configure the replica at runtime to replicate only the databases that
are configured with replicas and prevent any unexpected behavior.

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

<!-- Note that API documentation changes are now addressed by the
product design team. -->

- [x] Added/updated tests
- [x] Manual QA for all new/changed functionality
2024-07-01 11:19:02 -03:00
..
cached_mysql 19016 ingest certs on start (#19360) 2024-05-30 18:18:42 -03:00
filesystem Add cron job to cleanup unused software installers (#18812) 2024-05-07 16:50:44 -04:00
mysql prevent errors on tests that use real replicas (#20121) 2024-07-01 11:19:02 -03:00
mysqlredis Support matching a host in orbit enrollment using the serial number (#9612) 2023-02-28 12:55:04 -05:00
redis Address multiple redis-related issues observed with live queries (#16855) 2024-02-27 19:35:27 -06:00
s3 feat: new software installer and carves fields, kept original fields for backwards compat (#19597) 2024-06-10 13:35:27 -04:00