原子批次在Cassandra [英] Atomic Batches in Cassandra

查看:316
本文介绍了原子批次在Cassandra的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

批处理语句是什么意思是cassandra中的原子?文档在本质上是有点混乱的是精确的。是否意味着查询在群集中的节点上是原子的?

What do you mean by Batch Statements are atomic in cassandra? Docs are a bit confusing in nature to be precise. Does it mean that queries are atomic across nodes in cluster?

例如,我有一个包含100个查询的批处理。如果批处理中的第40个查询失败,批处理中执行的39个查询会发生什么?

Say,for example, i have a batch with 100 queries. If the 40th query in batch fails, what happens to the 39 queries executed in the batch?

我知道有一个批处理创建了,的部分批次的一致性。它是否删除39个条目中的其余部分,并提供批处理查询的所需原子性质。

I understand that there is a batchlog created under the hood and it will take care of the consistency for partial batches. Does it remove the rest of the 39 entries and provide the required atomic nature of batch queries.

在MYSQL中,我们将autocommit设置为false,因此我们可以回滚。在这些情况下,cassandra是否回滚?

In MYSQL, we set autocommit to false and hence we can rollback. Does cassandra rollback in those cases?

推荐答案

它们实际上称为记录批次而不是原子批次。

They are actually called Logged batches not Atomic batches. You get more than just hints (which you'd get for any write) you also get the batch replicated to 2 other nodes before the coordinator starts to do the writes.

对于您的具体问题它删除了39个条目中的其余部分并提供批处理查询的所需原子性质

For your specific question "Does it remove the rest of the 39 entries and provide the required atomic nature of batch queries"

否 - Casssandra没有回滚的概念。批处理日志副本将继续重试查询,直到它们都成功。

No - Casssandra has no notion of rollback. The batch log replicas will keep retrying the query until they all succeed.

这篇关于原子批次在Cassandra的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆