简体   繁体   中英

Cassandra - Cannot achieve consistency level QUORUM ISSUE

I am using Cassandra DB for a few purposes in the project. I am trying to update the count of votes_up column in the comments table. But I am getting this error.

enter image description here

My comments table structure is.

CREATE TABLE opspot.comments (
    entity_guid varint,
    parent_guid_l1 varint,
    parent_guid_l2 varint,
    parent_guid_l3 varint,
    guid varint,
    access_id varint,
    attachments map<text, text>,
    body text,
    container_guid varint,
    flags map<text, boolean>,
    has_children boolean,
    owner_guid varint,
    owner_obj text,
    replies_count varint,
    score varint,
    time_created timestamp,
    time_updated timestamp,
    votes_down set<varint>,
    votes_up set<varint>,
    PRIMARY KEY (entity_guid, parent_guid_l1, parent_guid_l2, parent_guid_l3, guid)
) WITH CLUSTERING ORDER BY (parent_guid_l1 ASC, parent_guid_l2 ASC, parent_guid_l3 ASC, guid DESC)
    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 crc_check_chance = 1.0
    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 = '99PERCENTILE';

Cassandra is using one data center that is datacenter1. The image is given below.

enter image description here

The current consistency level is one. with 1 node.

Can anyone tell me why I am getting this quorum error? As per my research, to achieve a stable quorum state more than one node is required. I am getting this error while updating a record. How could I handle this situation for one node as no copies are getting created?

QUORUM & LOCAL_QUORUM are calculated from the replication factor, not from the number of nodes in the cluster, so the QUORUM on the one node cluster is perfectly fine.

Most probably in your case is that your node is not answering on time, for example, because of garbage collection, or something else, and in this case, it doesn't achieve necessary consistency level. The same problem could exist even with ONE .

I'm not expert in use of PHP driver, but in other driver you can usually force retries, usually should work with default retry policy - you just need to mark statement as idempotent (see documentation on retry policy in Java driver ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM