一致性为LOCAL_ONE的读取查询期间,Cassandra失败(需要1个响应,但仅响应0个副本,其中1个失败)

Pra*_*ani 5 java cassandra-3.0

下面是我的脚本

CREATE TABLE alrashed.tbl_alerts_details (
    alert_id int,
    action_required int,
    alert_agent_id int,
    alert_agent_type_id int,
    alert_agent_type_name text,
    alert_definer_desc text,
    alert_definer_name text,
    alert_source text,
    alert_state text,
    col_1 text,
    col_2 text,
    col_3 text,
    col_4 text,
    col_5 text,
    current_escalation_level text,
    date_part date,
    device_id text,
    driver map<text, text>,
    is_processed int,
    is_real_time int,
    location map<text, text>,
    seq_no int,
    severity text,
    time_stamp timestamp,
    transporter map<text, text>,
    transporter_name text,
    trip_id int,
    updated_on timestamp,
    vehicle map<text, text>,
    vehicle_type_name text,
    PRIMARY KEY (alert_id)
    ) WITH read_repair_chance = 0.0
    AND dclocal_read_repair_chance = 0.1
    AND gc_grace_seconds = 864000
    AND bloom_filter_fp_chance = 0.01
    AND caching = { 'keys' : 'ALL', 'rows_per_partition' : 'NONE' }
    AND comment = ''
    AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold' : 32, 'min_threshold' : 4 }
    AND compression = { 'chunk_length_in_kb' : 64, 'class' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
    AND default_time_to_live = 0
    AND speculative_retry = '99PERCENTILE'
    AND min_index_interval = 128
    AND max_index_interval = 2048
    AND crc_check_chance = 1.0;  
Run Code Online (Sandbox Code Playgroud)

当我运行此查询时,

在一致性为LOCAL_ONE的读取查询期间,Cassandra失败(需要1个响应,但仅响应0个副本,失败1个)错误

这是我在Java中的cassandra查询:

select
  count( * )
from
  tbl_alerts_details
where
  alert_state = 'ACKNOWLEDGE'
  and date_part >= '2017-10-01'
  and date_part <= '2017-10-31'
  and is_real_time = 1
  and alert_agent_type_name = 'VEHICLE' ALLOW FILTERING
Run Code Online (Sandbox Code Playgroud)

Jam*_*ino 5

这个错误让我们意识到了空间问题,在每一行中以 Base64 存储图像很快就导致了问题的Tombstone出现。

根据这篇文章

Cassandra 不仅扫描行,而且还必须在准备响应时将它们累积在内存中。如果事情超出范围,这可能会导致节点上出现内存不足错误,并且如果多个节点正在为请求提供服务,甚至可能会导致导致整个集群崩溃的多重故障。为了防止这种情况发生,如果服务检测到危险数量的逻辑删除,则会中止查询。