问题
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:
- Insert with
using timestamp [millis]
- fine - Insert with timestamp info generated by client in primary key column - fine
- 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