Leonardo
Leonardo

Reputation: 3191

Finding by id in Cassandra does not work

I'm having a weird behavior with Cassandra. Whenever I try finding some rows by id, it returns me null (either by cqlsh console or clients), but the register exists if I find by another field. For example: enter image description here

My table schema:

CREATE TABLE IF NOT EXISTS user_aggregation_new.user_aggregation_new (
    userid timeuuid PRIMARY KEY,
    fullname text,
    birthdate text,
    password text,
    mobile text,
    address frozen <address>,
    thumbs map<text, text>,
    driverlicense frozen <driverlicense>,
    cpf text,
    facebookid text,
    membershipsince timestamp,
    rating double,
    email text,
    status text,
    facebookemail boolean,
    bankaccount list<frozen <bankaccount>>,
    dateupdated timestamp,
    version bigint
);

Cassandra version: 3.7

Why is this happening ?

Upvotes: 1

Views: 117

Answers (1)

Adrien Piquerez
Adrien Piquerez

Reputation: 1044

You have two options :

  • Run nodetool repair on each node to improve data consistency

  • Increase your client consistency level. In cqlsh, run the command CONSISTENCY with value QUORUM or ALL

Then retry and get back to us if it is still not working.

Upvotes: 2

Related Questions