22장. VM rolling deployment와 load balancer drain을 연결한다
한 대씩 load balancer에서 제외하고 in-flight request를 drain한 뒤 배포·health check·재등록한다. health가 process alive만 보면 DB migration이나 downstream 오류를 놓친다. readiness와 업무 synthetic check를 분리한다.
disable backend -> wait drain -> deploy digest -> start
-> readiness -> synthetic transaction -> enable backend
세션 affinity가 있으면 사용자가 로그아웃되거나 오래된 version에 묶일 수 있다. session store와 backward compatibility를 검토한다. batch·scheduler가 여러 VM에서 중복 실행되지 않게 leader/lock과 배포 순서를 설계한다.
rollback은 binary만이 아니라 config와 DB compatibility를 포함한다. 이전 binary가 새 schema를 읽을 수 있어야 rolling/rollback이 가능하다.