Cassandra WriteTimeout当" IS not NULL"物化观点的条件未得到满足

时间:2016-09-01 13:47:39

标签: cassandra

我有这张表和物化视图:

CREATE TABLE bubu (
    a text,
    b text,
    c text,
    d text,
    PRIMARY KEY (a, b));


CREATE MATERIALIZED VIEW bubu_mv AS
    SELECT *
    FROM bubu
    WHERE a IS NOT NULL AND b IS NOT NULL AND c IS NOT NULL
    PRIMARY KEY (a, c, b)

当我执行此插入然后执行此更新时,插入成功但更新返回写入超时

insert into bubu (a,b,c,d) values ('1','2',null,'3');
update bubu set d = '5' where a = '1' and b = '2';
WriteTimeout: Error from server: code=1100 [Coordinator node timed out waiting for replica nodes' responses] message="Operation timed out - received only 0 responses." info={'received_responses': 0, 'required_responses': 1, 'consistency': 'ONE'}

这发生在cassandra 3.7上并且不会发生在cassandra 3.2.1上(我试过的只有2个版本)。

另外,如果插入是这样的,则不会发生:

insert into bubu (a,b) values ('1','2');

如果我将conf / cassandra.yaml中的write_request_timeout_in_ms增加到20000,我会在~10秒后超时:

update bubu set d = '5' where a = '1' and b = '2';
OperationTimedOut: errors={}, last_host=127.0.0.1

这是cassandra中的错误还是我做错了什么?

1 个答案:

答案 0 :(得分:0)

您可以在配置文件conf/cassandra.yaml中增加超时值并检查。如果需要,请重新启动服务器。

write_request_timeout_in_ms: 20000