32장. GTID 복제·Failover 게임데이
연습 전 @@server_uuid, @@global.gtid_executed, source/replica status, Seconds_Behind_Source 외의 relay/applier 상태, retrieved/executed GTID를 저장한다. lag 0이 데이터 동일성을 증명하지 않으므로 heartbeat와 business invariant를 함께 본다.
source 중단 후 새 primary를 선정할 때 GTID set이 가장 앞선 정상 member인지 확인한다. old source를 network/storage/process 층에서 fencing한 뒤 promote한다. Router/Proxy/DNS 전환과 driver reconnect, pool의 오래된 connection, transaction unknown outcome을 실험한다.
전환 후 gtid_executed의 공백, 결제/주문 대사, duplicate idempotency key, read-after-write를 검증한다. old source는 자동 재합류시키지 않고 errant GTID와 rebuild 필요성을 분석한다.