0
votes

Background: I come from many years of Oracle experience. About 3 years ago, started down the distributed path with Cassandra/DSE. I have a very good grasp on Cassandra. Over the past month, I have heard cockroachdb mentioned several times. So now, as I'm familiar with cassandra, I get thrown this curve ball to look at. cockroachdb sounds a lot like cassandra in how it writes - with the client CL of QUORUM (I don't believe cockroachdb uses immutable files, however, but more like a RDBMS with physical rows (kv pairs)). That being said, I also understand very well how Cassandra reads data - but there isn't any real good documentation/videos/discussions on the reading mechanics of cockroachdb.

Let's assume this scenario:

3 nodes - a, b and c
RF=3
leader (node 'a') gets a write request
Writes to 2 nodes ('a' and 'b' - node 'c' is down)
leader acknowledges write
leader goes down (node 'a' is down) while node 'c' comes back up
leader becomes, say, node 'c'
read comes in for previously written data, above

As C didn't get the change, what is displayed to the client? Does it do quorum as well? If so, does it "fix" the data during the read?, etc. At some point, something "fixes" the data. In cassandra changes are stored for 3 hours before dropped (then repair has to be run). What about cockroachdb? How are "lost changes" sent to nodes that were unavailable.

I don't believe these levels of discussions are documented very well, or at least to me it isn't.

-Jim

1

1 Answers

1
votes

You have confused your problem statement by not clearly defining when things happen -- it is not clear whether A dies before or after C has become a new leader.

The reason why this matters is that when node C comes back up, it won't be able to participate in leader elections unless it "catches ups" with the raft log, the history of committed writes so far. Until C has all the data that A and B had, it won't become the new leader.

If node A dies before C has caught up, there won't be any leader any more and the range will become unavailable (read/writes will stall).

Does this clarify?