177 karma · joined Sep 21, 2010 (16y ago) · 79 submissions
comment 9y ago · link · parent
With single-decree Paxos you can write a storage which provides the following API:
function changeQuery(key, change, query) {
var value=this.db.get(key); value = change(value);
this.db.commit(key, value);
return query(value);
}
By providing different implementations of change & query you can achieve different beviour including CAS.
comment 9y ago · link · parent
1. There are tasks which don't require atomic multi-key updates
2. Atomic multi-key updates can be implemented on the client side (see RAMP, Percolator transactions or the Saga pattern)
3. Once the data overgrow the size of one machine you need to shard the log and at this time you're in the same situation
comment 9y ago · link · parent
It's wrong. In Grydka (Single-decree Paxos) all the keys are independent so it's possible to update them at the same time without blocking.
Grydka's throughput is comparable to Etcd on the same type of machines (4720 vs 5227 rps) and I never optimized for it (my goal was to fit 500 lines) so it's also wrong that it's "non-trivial to achieve the same level of throughput" - I did it by accident.
So I don't understand why Raft is a better base to build a fast high-throughput consensus protocol.
comment 9y ago · link · parent
comment 9y ago · link · parent
An instance may be running in virtual environment where time freezes are possible. A human may make an error and rollback time to 1970.
It's impossible to eliminate all these factors so yes I don't trust time but I trust CPU.
Maybe CockroachDB is doing it correctly but the terrible default settings make this optimisation negligible because when the leader dies the system hangs for 12 seconds.
comment 9y ago · link · parent
It isn't a small unavailability, it's an unavailability of the whole replica. If you don't have a lot of data then it's the whole cluster :)
Of cause, we can introduce something like virtual replicas and eventually end up with a replica per key which is almost a Single Decree Paxos but with an overhead on log compaction and snapshotting.
comment 9y ago · link · parent
Folk from Elastifile demonstrated it in their Bizur paper - https://arxiv.org/abs/1702.04242v1
comment 9y ago · link · parent
If you can't afford stale reads then you should ask Etcd to wait for confirmation from the majority of followers before acknowledging a read with ?quorum=true. It makes Etcd do 1 round trip for reads (just like Gryadka).
The same is applicable to other products (you can't relay on time in distributed systems, unless you're Google, consequently you can't relay on read leases)
So there is no performance penalty.
comment 9y ago · link · parent
It's wrong. If you're fine with stale reads then you don't a living master, but if you want to have a guarantee that the read value is up-to-date then the living master is necessary.
Etcd has a bug related to this - https://github.com/coreos/etcd/issues/741
comment 9y ago · link · parent
comment 9y ago · link · parent
Proof of the algorithm: http://rystsov.info/2015/09/16/how-paxos-works.html
Moreover, I built a system on top of it and extensively tested it with fault injections: https://github.com/gryadka/js.
It seems that GoshawkDB[1] uses the similar idea, Treode[2] used it too.
comment 9y ago · link · parent
What do you mean? Single Decree Paxos is linearizable so it's consistent. When the multi-key updates are necessary - they can be implemented with client-side transactions such as 2PC, RAMP or Percolator.
Even with Raft we in the same situation. Once the data overgrows the size of one machine we need to shard them. As a result some keys can live on different shards and we need cross shards transactions to do multi-key updates :)
comment 9y ago · link · parent
1) The atomicity usually isn't a problem, it can be added on top of the sharded storage with 2PC, RAMP or Percolator transactions, or with Sagas.
2) With Raft you have to implement log compaction and snapshotting, with Bizur and Single-Decree Paxos it isn't the case
comment 9y ago · link · parent
It's half true. Paxos is an ambiguous term. It includes Multi-Paxos and Single-Decree Paxos (aka Synod). The first one is a log based algorithm, while the second is a just a register. So your critic is valid only for the first part of the Paxos family.
Actually, Bizur is very similar (almost indistinguishable) to Single Decree Paxos - just compare it with the algorithm described in the video [1] by Heidi Howard or in my post "In search of a simple consensus algorithm" [2]
comment 9y ago · link · parent
If it's true then it looks very suspicious that avg. latency decreases as the number of concurrent clients goes up. How do you measure avg. latency?
Let me illustrate what the avg. latency usually means.
Imagine that we have two concurrent users: Alice and Bob. During the testing lasting one second, Alice managed to send 3 requests per second, the first request took 0.5 seconds while the rest were executed in a quarter of a second each. In the same time, Bob did only 2 requests, each of them took 0.5 seconds.
So the average latency is the sum of execution time taken by each request divided by the number of all requests, in our case it's (0.5+0.25+0.25+0.5+0.5) / 5 = 0.4
Did you use the same definition?
comment 9y ago · link · parent
It's wrong. Etcd provides "?quorum=true" option which makes reads go through the Raft consensus algorithm archiving linearizability see https://github.com/coreos/etcd/issues/741
55.
In search of a simple consensus algorithm(rystsov.info ↗)
9 points · by rystsov · 9y ago · discuss
comment 9y ago · link · parent