cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Edward Capriolo (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-12431) Getting null value for the field that has value when query result has many rows
Date Tue, 13 Sep 2016 21:21:20 GMT


Edward Capriolo commented on CASSANDRA-12431:

Thinking on this more. You can insert null values into this table. 

Are you absolutely sure you are not inserting null?

cqlsh:eventualtest> insert into email_histogram (id, email,score) values ('1','8', null);
cqlsh:eventualtest> select * from email_histogram where id='1';
 id | email | score
  1 |     1 |   3.3
  1 |     2 |   3.3
  1 |     3 |  null
  1 |     5 |   5.5
  1 |     7 |  null
  1 |     8 |  null

We update the table every 3 weeks. The table has 20k rows for each key (guid) I'm querying

In the schema you provided there are no guid columns. I am assuming you mean the text column.

Is a GUID ever reused? Every three weeks: 
* Do you tombstone the entire partition?
* Do you tombstone all the columns in the partition?
* Is the partition only written once and never used again?

One a bad partition is found, Does it continue displaying this odd behavior? Or can the problem
not be replicated on the same partition?

Unfortunately running load tests do not easily replicate this behavior: 
My suggestions are: 
* Run your read at quorum (determine if this issue still happens)
* write the row at ALL (it sounds like you are writing from batch)
* Enable tracing and attempt to catch this condition
* This condition is fairly easy to detect, run the query 2 times and merge non null results
in code.

My suspicion is un-repaired partitions that are different across machines.  Maybe someone
can punch a hole in that theory.

> Getting null value for the field that has value when query result has many rows
> -------------------------------------------------------------------------------
>                 Key: CASSANDRA-12431
>                 URL:
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Fei Fang
>            Assignee: Edward Capriolo
>             Fix For: 2.2.x
> Hi,
> We get null value (not an older value, but null) for a float column (score) from a 20k
result row query. However, when we fetch data for that specific row, the column actually has
> The table schema is like this:
> {code}
> CREATE TABLE IF NOT EXISTS email_histogram (
> id text,
> email text,
> score float,
> PRIMARY KEY (id, email)
> ) WITH bloom_filter_fp_chance = 0.01
> AND caching = 'KEYS_ONLY'
> AND comment = ''
> AND compaction =
> {'tombstone_threshold': '0.1', 'tombstone_compaction_interval': '300', 'class': 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy'}
> AND compression =
> {'sstable_compression': ''}
> AND dclocal_read_repair_chance = 0.1
> AND default_time_to_live = 864000
> AND gc_grace_seconds = 86400
> AND memtable_flush_period_in_ms = 0
> AND read_repair_chance = 0.0
> AND speculative_retry = '99.0PERCENTILE';
> {code}
> This is my read query: SELECT * FROM " + TABLE_NAME + " WHERE guid = ?
> I'm using consistency One when querying it and Quorum when updating it. If I insert data,
I insert for all the columns, never only part of the column. I understand that I might get
out of date value since I'm using One to read, but again here I'm not getting out of date
value, but just "null". 
> This is happening on our staging server which servers 20k users, and we see this error
happening 10+ times everyday. I don't have an exact number of how many times we do the query,
but nodetool cfstats shows local read count of 85314 for this table for the last 18 hours
and we have 6 cassandra nodes in this cluster so about 500k querying for 18 hours.
> We update the table every 3 weeks. The table has 20k rows for each key (guid) I'm querying
for. Out of the 20k rows, only a couple at most are null and they are not the same every time
we query the same key.
> We are using C# driver version 3.0.1 and Cassandra version

This message was sent by Atlassian JIRA

View raw message