mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-28 10:41:12 +00:00
We want for the decommissioning node to wait before shutting down until every node learns that it left the token ring. Otherwise some nodes may still try coordinating writes to that nodes after it already shut down, leading to unnecessary failures on the data path(e.g. for CL=ALL writes). Before this change, a node would shut down immediately after observing that it was in `left` state; some other nodes may still see it in `decommissioning` state and the topology transition state as `write_both_read_new`, so they'd try to write to that node. After this change, the node first enters the `left_token_ring` state before entering `left`, while the topology transition state is removed (so we've finished the token ring change - the node no longer has tokens in the ring, but it's still part of the topology). There we perform a read barrier, allowing all nodes to observe that the decommissioning node has indeed left the token ring. Only after that barrier succeeds we allow the node to shut down.