2

As I understand a row in a cassandra table is a Set of Key-value pairs (corresponding to each column)

I notice a strange issue during insert, values are not persisted in couple of columns, though I am fairly confident it has values before insert.

It happens sporadically and succeeds if we retry later. We are suspecting some kind of race condition or db connection drop etc.

Is it possible that only a subset of keys gets saved in a row of cassandra table ? Does cassandra guarantee all or nothing during save (row level consistency)

Cassandra Version : 2.1.8

Datastax cassandra-driver-core : 3.1.0

Vinod Jayachandran
  • 3,726
  • 8
  • 51
  • 88

2 Answers2

2

On the row level the concurrency guarantees are described pretty much in this answer.

Cassandra row level isolation

As far as your problem goes. First check if it's really cassandra with dropped mutations

nodetool tpstats

If you see dropped mutations, it's likely you are running underpowered setup and you simply have to put more hardware to the problem you are facing.

There isn't really more from your question that I can tell. Just as a precaution, please go into your code and check that you are actually creating a new bound statement every time and that you are not reusing the created bound statement instance. Once a client had this issue that the inserts were lost under mysterious circumstances and that was it. Hope this helps you, if not please give some code that you have.

Community
  • 1
  • 1
Marko Švaljek
  • 2,071
  • 1
  • 14
  • 26
0

There are consistency levels for read and writes in Cassandra.

It looks like you are using consistency level one, so your reads/writes are not consistent. Try to use quorum for both reads and writes and see if the problem resolves.

If this doesn't help, please provide example query, cluster size, rf factor.

nevsv
  • 2,448
  • 1
  • 14
  • 21