Do I need clock synchronisation for cassandra if only one client writes to cluster?

只愿长相守 提交于 2020-01-24 10:41:05

问题


From cassandra's documentation I got to know that cassandra uses timestamps of query to resolve conflicts between two writes and hence the clocks on all the nodes of the cluster needs to be synchronised. In my use-case we have only one client writing to the cluster and multiple clients reading from the cluster. So, if I use client-side timestamp generator (which I believe is default for version>3) do I still need to have cluster node clocks synchronised with each other?


回答1:


In the context of write timestamps associated with data being stored, clock synchronization is not needed if you are using client timestamps and a single client.

However, I would still discourage not at least trying to keep clocks in sync in a Cassandra cluster. There have been cases where clock skew affects other parts of Cassandra. For example, CASSANDRA-11991 shows a case where clock skew effected the node clocks used for light weight transactions. While that particular issue has been addressed, it still seems like a good idea to make an effort to synchronize.




回答2:


It depends:

  1. Insert with using timestamp [millis] - fine
  2. Insert with timestamp info generated by client in primary key column - fine
  3. Regular inserts without client set time in primary key - might be a good idea to keep the clocks in sync


来源:https://stackoverflow.com/questions/43416917/do-i-need-clock-synchronisation-for-cassandra-if-only-one-client-writes-to-clust

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!