Cassandra:反击" SOME"键没有增加?

时间:2016-11-18 06:23:41

标签: cassandra cqlsh

我有一个名为 campaignvariantaction 的非常简单的Cassandra表,其中一个名为 val 的计数器列。我今天遇到了一个非常奇怪的问题。对于某些键,Cassandra增加计数器就好了。对于其他人来说,它并没有做到。我对这是怎么回事感到非常困惑。

Cassandra Shell(cqlsh)的示例输出如下。请注意增量计数器如何适用于一个键(前3个示例)并且不适用于另一个键(最后一个示例)。

Ussntu上的Cassandra 2.2.7版。

cqlsh:z> UPDATE campaignvariantaction SET val = val + 1 WHERE campaignvariantaction = 'campaign_variant#54408#sent' AND date = 20161118;
cqlsh:z> select * from campaignvariantaction where campaignvariantaction = 'campaign_variant#54408#sent';

 campaignvariantaction             | date     | val
-----------------------------------+----------+-----
 campaign_variant#54408#sent | 20161118 |   1

(1 rows)
cqlsh:z> UPDATE campaignvariantaction SET val = val + 1 WHERE campaignvariantaction = 'campaign_variant#54408#sent' AND date = 20161118;
cqlsh:z> select * from campaignvariantaction where campaignvariantaction = 'campaign_variant#54408#sent';

 campaignvariantaction             | date     | val
-----------------------------------+----------+-----
 campaign_variant#54408#sent | 20161118 |   2

(1 rows)

    cqlsh:z> UPDATE campaignvariantaction SET val = val + 1 WHERE campaignvariantaction = 'campaign_variant#979165#sent' AND date = 20161118;
    cqlsh:z> select * from campaignvariantaction where campaignvariantaction = 'campaign_variant#979165#sent';

     campaignvariantaction | date | val
    -----------------------+------+-----

    (0 rows)

描述输出:

cqlsh:z> describe table campaignvariantaction ;

CREATE TABLE z.campaignvariantaction (
    campaignvariantaction text,
    date int,
    val counter,
    PRIMARY KEY (campaignvariantaction, date)
) WITH CLUSTERING ORDER BY (date ASC)
    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'}
    AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}
    AND dclocal_read_repair_chance = 0.1
    AND default_time_to_live = 0
    AND gc_grace_seconds = 864000
    AND max_index_interval = 2048
    AND memtable_flush_period_in_ms = 0
    AND min_index_interval = 128
    AND read_repair_chance = 0.0
    AND speculative_retry = '99.0PERCENTILE';

0 个答案:

没有答案