Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

HDC avatar image
HDC asked ·

Cassandra 扩容过程中,新写入的涉及到要迁移的token,怎么传输?

Cassandra 扩容过程中,我理解应该一开始就计算好迁移哪些SSTable文件,我们从netstats可以看到结果。如果在扩容的过程中,有写入请求到要迁移的token,这部分的增量数据会怎么迁移呢?包括commitlog,SSTable,还有没有flush到磁盘的内存里的数据。

bootstrap
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered ·

When a node is added to the cluster, it will receive new mutations (write requests) for the token range it will eventually own while it is bootstrapping. This means that the existing owner of the token range and the new node is receiving new write requests at the same time during the bootstrap.

But the new node will not accept read requests until the B has completed. Cheers!

一个新节点在加入到cluster的时候,它会被标记成UJ状态(意味着UP and Joining)。处于Joining状态的节点已经被安排好了它将要负责的Token Range,所以任何涉及到这个新Token Range的写请求都会被多写一份到这个新节点,在Joining完成之前(也就是Bootstrapping期间),已有的负责这些Token Range的节点仍然会收到所有的写请求。这意味着token range的现有所有者和新节点在bootstrap期间会同时接收新的写请求。

但是新节点将在bootstrap完成之前不接受读取请求。

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.