Cassandra行级隔离 [英] Cassandra row level isolation

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

问题描述

我在cql中创建了一个表:

I have a table created in cql :

create table isolation_demo(key text,column1 text,column2 text,column3 text ,primary key(key,column1,column2));

我有2条语句.

update isolation_demo set column3 ='ABC' where key =1 and column1 =1 and column2=1;
delete from isolation_demo where key =1 and column1 =2 and column2=2;

此处两个语句共享相同的分区键. (键= 1),但聚类列的值不同.这两个语句会被隔离吗?

here the both statements share same partition key. (key=1), but different clustering column values. Will these 2 statements be isolated?

推荐答案

这些查询必须隔离,如C * docs 此处:

These queries must be isolated, as mentioned in C* docs here and here:

在早期版本的Cassandra中,当一个用户正在更新该行而另一用户正在读取同一行时,则有可能看到一行中的部分更新.例如,如果一个用户正在写一个包含两千列的行,那么另一位用户可能会读取同一行并看到其中一些列,但是如果写仍在进行中,则不是全部.

In early versions of Cassandra, it was possible to see partial updates in a row when one user was updating the row while another user was reading that same row. For example, if one user was writing a row with two thousand columns, another user could potentially read that same row and see some of the columns, but not all of them if the write was still in progress.

完全的行级隔离到位,这意味着对行的写操作与执行写操作的客户端是隔离的,直到其他用户看不到为止.

Full row-level isolation is in place, which means that writes to a row are isolated to the client performing the write and are not visible to any other user until they are complete.

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

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