News for hackers. Stuff that matters.
Re:The Limits of the CAP Theorem by falcolas on Tuesday June 27, 2017 @01:03PM (#14647124)
> In the event that the leaseholder is partitioned away from the other replicas, it will be allowed to continue to serve reads (but not writes) until its lease expires (leases currently last 9 seconds by default), and then one of the other two replicas will get a new lease (after waiting for the first replica’s lease to expire).

So, what happens to readers who are partitioned away from the node which holds that data? Can they not read the data for that lease duration? If they can't, then yeah, CP is a good description.

...

So the design doc seems to hold this up - reads must go to the lease holder, until the lease expires. Nice.

EDIT: Design doc link:

https://github.com/cockroachdb/cockroach/blob/master/docs/de...

Re:The Limits of the CAP Theorem by bdarnell on Tuesday June 27, 2017 @02:26PM (#14647898)
Yes, that's correct. If you are partitioned away from the lease holder, then you can't read until either the partition heals, or the lease expires and a new lease is granted to a node that you can reach.

Writes require the lease too, so it is not possible for a quorum of nodes on one side of a partition to serve writes while a lease holder on the other side serves stale reads. This is a degenerate case of quorum leases (https://www.cs.cmu.edu/~dga/papers/leases-socc2014.pdf) for a single lease holder; in the future we're interested in supporting multiple lease holders to improve read latency (at the expense of write performance and availability).

Re:The Limits of the CAP Theorem by YZF on Tuesday June 27, 2017 @01:14PM (#14647247)
If a partitioned node can serve reads and the other nodes can serve writes then you must be reading stale data though.
Re:The Limits of the CAP Theorem by falcolas on Tuesday June 27, 2017 @01:48PM (#14647552)
Writes also require the lease, so no data can be written until the lease expires.

Writes becoming unavailable during a partition is a reasonable solution for a CP system.

Re:The Limits of the CAP Theorem by Groxx on Tuesday June 27, 2017 @01:44PM (#14647521)
Yeah, that outcome seems pretty straightforward...

It's probably not hard to require that writes (which require a majority) also require the lease-holder to ack the write, which seems like it'd solve this. It's a bit odd that they don't mention anything like this, but it is a fairly short blog post.

A bit of lazy browsing didn't lead me to any more detailed descriptions of how it handles partitions. Anyone else know?

Re:The Limits of the CAP Theorem by falcolas on Tuesday June 27, 2017 @01:49PM (#14647566)
Writes can only get issued from the partition holder, in addition to reads. I had to dig into the documentation links to find the design doc on github, which detailed this behavior.
Re:The Limits of the CAP Theorem by readams on Tuesday June 27, 2017 @01:34PM (#14647426)
Allowing stale reads is a pretty weak version of consistency.
Re:The Limits of the CAP Theorem by falcolas on Tuesday June 27, 2017 @01:45PM (#14647532)
The reads, per the design doc, can't get stale, because the values can't be updated until the lease ends.