Astyanax: If a MutationBatch fails halfway, what guarantees do I have?

断了今生、忘了曾经 提交于 2019-12-24 02:16:32

问题


I know that as of 0.8, Cassandra guarantees that row updates are atomic.

However, if I prepare (using MutationBatch) several row modifications or modifications across several column families, is it guaranteed that the rows will be updated in the order that in which I set them up? e.g. If I have

  • Update CF 1, Row 1
  • Update CF 1, Row 2
  • Update CF 2, Row 3

is it possible for CF 2 to be updated while CF 1 remains unchanged due to failure?

What happens if I had set up:

  • Update CF 1, Row 1, Column A
  • Update CF 1, Row 2
  • Update CF 2, Row 3
  • Update CF 1, Row 1, Column B

Alternatively, should I be preparing instead three MutationBatches and executing them separately?


回答1:


All updates are done in parallel, so no ordering is ever guaranteed. Partial success will result in the batchlog taking over and finishing the batch starting in 1.2: http://www.datastax.com/dev/blog/atomic-batches-in-cassandra-1-2




回答2:


Playorm provides flush support which pushes all your persists down in one shot so it is sort of sends it as a unit of work(NOT a transaction)

http://buffalosw.com/wiki/flush-support/



来源:https://stackoverflow.com/questions/15662657/astyanax-if-a-mutationbatch-fails-halfway-what-guarantees-do-i-have

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