1

We have a setup where we have 3 cassandra nodes running as a cluster. We are using cassandra docker container with cassandra version 4.1.3.

So, in this scenario what happens when one of the node receives docker stop command?

Are we going to stop gossiping and drain the data before that node fully shutdown?

Is cassandra 4.1.3 internally handling the graceful shutdown (stop gossip and drain before shutdown)?

If not, is it not creating loss of data from that node?

1 Answer 1

1

When stopping a container with the docker stop command, Docker sends a TERM signal to the main process in the container then after a grace period (usually 30 seconds), a KILL signal.

This sends an interrupt to Cassandra to shutdown gracefully, similar to sending a KILL signal to the Cassandra process. As one would expect, stopping a Cassandra container does not lead to data loss.

Note however that a regular shutdown does not initiate a nodetool drain so the commitlogs are replayed the next time the container is started.

For more info, see the stop command in the official Docker Docs. Cheers!

2
  • Thanks @Erick .. this is useful info. We are looking of how cassandra 4.1.3 behaves when it receives TERM of KILL signal. Is Cassandra process internally handling draining of data and stoping of gossips when it receives TERM or KILL signal?
    – Manju K B
    Commented Feb 16 at 15:47
  • As I stated in my answer, a regular shutdown does not include nodetool drain. Forcing a memtable flush with drain is a manual process. Cheers! Commented Feb 21 at 4:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.