Automated Failover Tests
Codify all Tier B failover tests into a reproducible script.
Tests (from manual session)
- Verify pre-failover topology (mysql1=master, mysql2/mysql3=replicas)
- Verify ProxySQL HG 10=mysql1, HG 20=mysql2+mysql3
- Graceful takeover:
curl /api/graceful-master-takeover/...
- Verify: mysql2 promoted to master (read_only=0)
- Verify: mysql1 demoted to replica (read_only=1)
- Verify: ProxySQL HG 10 updated to mysql2
- Verify: ProxySQL HG 20 has mysql1 as OFFLINE_SOFT
- Restore topology (mysql1=master)
- Hard failover:
docker stop mysql1
- Wait for orchestrator to detect DeadMaster (max 30s)
- Verify: Replica promoted to master
- Verify: ProxySQL writer hostgroup updated to new master
- Verify:
/api/v2/recoveries shows recovery event with IsSuccessful=true
- Restore mysql1 container
Files
tests/functional/test-failover.sh
Acceptance criteria
Depends on #46 (infrastructure) and #47 (smoke tests pass first).
Automated Failover Tests
Codify all Tier B failover tests into a reproducible script.
Tests (from manual session)
curl /api/graceful-master-takeover/...docker stop mysql1/api/v2/recoveriesshows recovery event with IsSuccessful=trueFiles
tests/functional/test-failover.shAcceptance criteria
Depends on #46 (infrastructure) and #47 (smoke tests pass first).