state fileのlockingとは?
state fileのlockingは、操作が実行されている間、インフラのstate fileへの排他アクセスを付与するメカニズムです。あるapplyがlockを保持している間、他の実行は並行して書き込む代わりに待機するか即座に失敗します。リモートbackendは調整サービスを使ってlockを実装し、分散したrunnerが安全に協調できるようにします。
なぜ重要か
2つの同時applyは書き込みを交錯させてstateを破損させ、インフラと記録を不整合にする可能性があります。lockingはミューテーションを直列化し、これはCI runnerが並列にapplyするときに不可欠です。
関連ガイド
What Is a Remote State Backend?A remote state backend stores infrastructure-as-code state in a shared, durable location so teams and CI runn…
What Is the Plan and Apply Cycle?The plan and apply cycle is the infrastructure-as-code workflow of computing a proposed change set, reviewing…
What Is a Distributed Lock?A distributed lock coordinates exclusive access to a shared resource across multiple processes or machines so…