Cassandra LWT reads

帅比萌擦擦* 提交于 2019-12-10 14:18:18

问题


It's my understanding that LWT inserts are always done with SERIAL consistency level. If true, does that mean that reading a row inserted as LWT, can be safely read with a consistency level of ANY?

In other words, I assume an LWT insert is fully consistent, making any subsequent read also fully consistent, regardless of consistency level?


回答1:


Your assumption is incorrect due to two reasons.

  1. SERIAL only implies QUORUM consistency level for writes
  2. There is a possibility that a single LWT will only be partially applied at time of reading and thus cannot be safely read with any CL

Therefor you need to use SERIAL for all queries that will read LWT writes. This will make sure that there are no pending LWTs while reading QUORUM.



来源:https://stackoverflow.com/questions/28836083/cassandra-lwt-reads

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