{"id":"IL-0327","org":"CircleCI","date":"2025-04-03","docs":["https://status.circleci.com/incidents/31n0h4tcl02g"],"title":{"en":"After a blue/green upgrade of CircleCI's workflows database every query hit disk, and workflow starts lagged or failed","ko":"워크플로 데이터베이스를 blue/green 으로 업그레이드한 뒤 워크플로 시작과 취소가 지연되고 실패했다"},"domain":["database"],"impact":{"scope":"Starting and cancelling workflows and jobs had increased latency and some failures, and workflows were slow or hard to view in the UI, from 22:08 to 23:45 UTC","users":"CircleCI customers","region":"unknown"},"review":{"written_by":"session","reviewed_at":null,"reviewed_by":null},"lessons":null,"related":[],"sources":[{"url":"https://discuss.circleci.com/t/post-incident-report-april-4-2025-delays-in-starting-workflows/53113","kind":"blog","archived":"https://web.archive.org/web/20251206111739/https://discuss.circleci.com/t/post-incident-report-april-4-2025-delays-in-starting-workflows/53113"}],"summary":{"en":"Around 22:00 UTC CircleCI started an upgrade of the database for the service that runs workflows, using a blue/green deployment. The analyze operation that rebuilds the database's statistics table, which the database uses for its indexes, had been run too early in the procedure, and a second major version upgrade within the same deployment made those statistics stale. After the cutover at 22:08, every query on the new database went to disk, the workflows service slowed, and jobs whose database calls exhausted their 10-minute retries were dropped. Upsizing the database, disabling non business critical operations and scaling the workflows service to one pod while the statistics were rebuilt did not help, so at 23:19 the team re-enabled writes on the old database and restored it as primary, which was complete at 23:29. The workflows queue was back to normal levels at 23:45 with no further errors. The root cause was found in the investigation after the incident.","ko":"2025-04-03 22:08 UTC 부터 23:45 UTC 까지 CircleCI 고객은 워크플로와 작업을 시작하고 취소할 때 지연과 일부 실패를 겪었고 UI 에서 워크플로를 보기 어려웠다. 22:00 무렵 워크플로 서비스의 데이터베이스를 blue/green 배포로 업그레이드했다. 팀은 90초 미만의 지연 동안 데이터베이스 호출이 큐에서 10분 동안 재시도될 것으로 예상했다. 22:08 에 전환이 끝나고 쿼리가 처리되는 것을 확인했지만, 22:17 에 지연이 커지고 10분 재시도를 다 쓴 작업이 버려졌다.\n\n22:30 에 워크플로 파드를 재시작해 모든 파드가 올바른 데이터베이스에 연결하게 했다. 22:35 에 공개 장애를 선언했다. 22:41 에 새 데이터베이스의 모든 쿼리가 디스크에서 읽히는 것을 보고 통계 테이블이 갱신되지 않았다고 판단했다. 팀은 곧바로 데이터베이스를 키우고 업무에 꼭 필요하지 않은 데이터베이스 작업을 껐다. 23:00 에 통계 테이블을 다시 만드는 동안 데이터베이스가 회복할 여유를 주려고 워크플로 서비스를 파드 하나로 줄였지만 성능은 나아지지 않았다. 23:19 에 옛 데이터베이스의 쓰기를 다시 켜고 옛 데이터베이스를 다시 주 데이터베이스로 되돌리기로 했다. 이 작업은 23:29 에 끝났다. 23:45 에 워크플로 큐가 정상 수준으로 돌아왔고 더 이상 오류가 보이지 않았다.\n\n장애 뒤 조사에서 근본 원인이 밝혀졌다. 인덱스에 쓰이는 통계 테이블을 다시 만드는 analyze 작업이 너무 일찍 실행됐고, 같은 배포 안의 두 번째 메이저 버전 업그레이드가 그 통계를 다시 낡게 만들었다."},"trigger":{"en":"A blue/green upgrade of the database behind the CircleCI workflows service cut over to the new database at 22:08 UTC.","ko":"22:00 UTC 무렵 워크플로를 맡는 서비스의 데이터베이스를 blue/green 배포로 업그레이드했고, 22:08 에 전환이 끝났다."},"severity":"unknown","symptoms":["high-latency","high-error-rate","database-overloaded"],"timeline":{"detected_after":"9m","resolved_after":"1h 37m"},"date_kind":"incident","detection":{"en":"At 22:17 UTC the team identified increased latency in the workflows service and errors from jobs dropped after exhausting their 10-minute retries.","ko":"22:17 UTC 에 워크플로 서비스의 지연이 커지고 10분 재시도를 다 쓴 작업이 버려지며 오류가 나는 것을 확인했다."},"components":["database","query-planner"],"root_cause":"deploy-rollout","remediation":[{"text":{"en":"Restarted the workflows pods so all of them connected to the correct database","ko":"22:30 UTC 에 모든 워크플로 파드가 올바른 데이터베이스에 연결하도록 파드를 재시작했다."}},{"text":{"en":"Upsized the new database and disabled non business critical operations on it","ko":"22:41 에 새 데이터베이스의 모든 쿼리가 디스크에서 읽히는 것을 보고 곧바로 데이터베이스 크기를 키우고 업무에 꼭 필요하지 않은 데이터베이스 작업을 껐다."}},{"text":{"en":"Scaled the workflows service down to a single pod while the statistics table was rebuilt","ko":"23:00 에 통계 테이블을 다시 만드는 동안 데이터베이스가 회복할 여유를 주려고 워크플로 서비스를 파드 하나로 줄였다."}},{"text":{"en":"Re-enabled writes on the old database and restored it as primary","ko":"23:19 에 옛 데이터베이스의 쓰기를 다시 켜고 옛 데이터베이스를 다시 주 데이터베이스로 되돌리기로 했다. 이 작업은 23:29 에 끝났다."}}],"action_items":[{"text":{"en":"Run an analysis procedure after every major version change in blue/green database deployments","ko":"blue/green 데이터베이스 배포 절차에서 메이저 버전이 바뀔 때마다 analyze 절차를 돌리도록 바꿨다."}},{"text":{"en":"Tested running analyze on a database under pressure, found it does not degrade performance further, and noted this for future remediation","ko":"부하가 걸린 데이터베이스에서 analyze 명령을 돌려도 성능이 더 나빠지지 않는다는 것을 시험으로 확인했다. 앞으로 복구할 때 참고하도록 이 결과를 적어 둔다."}},{"text":{"en":"Add automated tests and manual checkpoints throughout migrations to catch problems before the blue/green cutover","ko":"다음 마이그레이션 전에 자동 테스트와 수동 확인 지점을 절차 곳곳에 더해 blue/green 전환 전에 문제를 찾아 해결한다."}}],"contributing":[],"recurrence_of":null,"symptoms_text":{"en":"On April 3, 2025, from 22:08 to 23:45 UTC, CircleCI customers saw higher latency and some failures when starting and cancelling workflows and jobs, and had delays and trouble viewing workflows in the UI. Nine minutes after the blue/green cutover of the workflows database, the team found increased latency in the workflows service and errors from jobs dropped after using up their 10 minutes of retries.\n\nThe team had expected a delay of less than 90 seconds during the database upgrade, with database calls from the workflows service sent to a queue and retried over 10 minutes, and expected the queues to grow a little. At 22:08 the blue/green deployment was complete and queries were verified as being served. At 22:30 the team restarted the workflows pods to make sure all of them were connected to the correct database, and a public incident was declared at 22:35.\n\nAt 22:41 the team saw that all queries on the new database were hitting disk, a sign that the database statistics tables had not been updated. Upsizing the database, disabling all non business critical operations on it and, at 23:00, scaling the workflows service down to a single pod to let the database recover while the statistics table was rebuilt did not improve database performance by 23:10; the workflows queue only backed up, as expected with fewer pods.","ko":"blue/green 전환은 22:08 UTC 에 끝났다. 22:17 에 워크플로 서비스의 지연이 커졌고, 10분 재시도를 다 쓴 작업이 버려지며 오류가 났다. 고객은 워크플로와 작업을 시작하거나 취소할 때 지연과 실패를 겪었고 UI 에서 워크플로를 보기 어려웠다.\n\n팀은 업그레이드 중 90초 미만의 짧은 지연을 예상했다. 그동안 워크플로 서비스의 데이터베이스 호출이 큐로 가서 10분 동안 재시도되고, 큐는 업그레이드 중과 직후에 조금만 늘 것으로 봤다. 22:08 에 전환이 끝난 뒤 쿼리가 처리되는 것도 확인했다.\n\n22:30 에 모든 파드가 올바른 데이터베이스에 연결하는지 확인하려고 워크플로 파드를 재시작했다. 22:41 에 새 데이터베이스의 모든 쿼리가 디스크에서 읽히는 것을 보고 데이터베이스 통계 테이블이 갱신되지 않았다고 판단했다.\n\n23:00 에 워크플로 서비스를 파드 하나로 줄이자 예상대로 워크플로 큐가 쌓였지만 데이터베이스 성능은 나아지지 않았다."},"updated_at":"2026-11-14T12:33:58.017519Z","url":"https://benchlet.com/incidentlib/app/cases/IL-0327","org_slug":"circleci"}