Better HN
topnewbestaskshowjobs
Log inSign up

rystsov

177 karma · joined Sep 21, 2010 (16y ago) · 79 submissions

Submissions

comment 9y ago · link · parent

I described it in this post http://rystsov.info/2015/09/16/how-paxos-works.html

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

Assuming linearity is atomic multi-key updates:

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

> cannot start a paxos instance for a new log entry until all prior instances have been resolved

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

It can screw only to the worse side so I don't care about the true results as long as the lower bound is sufficient enough.

comment 9y ago · link · parent

Yes that's true if all the communication between agents goes through the database then the Monotonic Reads consistency level is equivalent to linearizability.

In case there are off the database communications then this level of consistency isn't enough.

comment 9y ago · link · parent

Thank you! I'll rework this paragraph to be correct, I wanted to make an observation that the given data (two attempts to implement key-value storages with keeping the length of a program as short as possible) favour Gryadka but of course isn't wrong to make strong statements based just on one data point.

comment 9y ago · link · parent

It would still lack "Consistent get operations", "Paxos group changes", be "bound to localhost" and do more than 1 round trip to commit.

What do you mean by pipelining?

comment 9y ago · link · parent

Making implicit assumptions about the environment is wrong.

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

Gryadka is less than 500 but supports membership change :) yet 3 hours on it is quite impressive

comment 9y ago · link · parent

> If you have one paxos/raft group per replica, you actually only get a small unavailability

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

I don't have a deep understanding of how ZAB works but based on the documentation (initLimit) and prior experience with ZooKeeper, ZAB has the same issues as Raft when a leader dies.

Folk from Elastifile demonstrated it in their Bizur paper - https://arxiv.org/abs/1702.04242v1

comment 9y ago · link · parent

Etcd used this scheme to provide fast reads but Aphyr demonstrated that it may lead to stale reads https://github.com/coreos/etcd/issues/741.

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

> consistent reads do not need a living master

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

Btw, Gryadka uses an idea of quorums with non-standard size to change a configuration of the cluster, see http://rystsov.info/2016/01/05/raft-paxos.html#details1. I came up with this idea independently of Howard when misread the Vertical Paxos paper :)

comment 9y ago · link · parent

What is the performance penalty you're talking about?

Gryadka does 1 roundtrip to write a value and its performance (4720 rps, 1.68ms latency) is very similar to Etcd (5227 rps, 1.55ms).

comment 9y ago · link · parent

Thanks, I didn't notice that the clients operate over the same key set, so I didn't think about the contention. It makes sense.

comment 9y ago · link · parent

Not really :) Please follow the links. "Paxos Made Simple" describes the write once variant, but it's possible to choose a new value for the next ballot cycles to make it rewritable.

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.

[1] https://goshawkdb.io/

[2] http://treode.github.io/design/

comment 9y ago · link · parent

> If you can sacrifice more, you can get Single Paxos

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

The paper is quite important - it's the first paper about the production usage of an algorithm similar to Single-Decree Paxos.

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

I got it, I was using Etcd v3.1.0 but with v2 API.

comment 9y ago · link · parent

> Paxos-like algorithms which are used by existing distributed file systems, can have artificial contention points due to their dependence on a distributed log.

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]

[1] https://www.youtube.com/watch?v=s8JqcZtvnsM

[2] http://rystsov.info/2017/02/15/simple-consensus.html

comment 9y ago · link · parent

I mean that without the ?quorum flag the stale reads are possible. I tested the etcd v3 (http api) and the reads were incredibly fast but when I set the flag, the read's latency became the same as write.

comment 9y ago · link · parent

What do you call by "queue depth". Is it the number of concurrent clients?

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

> We avoided reads (get operations) since the current version of etcd performs reads directly from the leader, without contacting the cluster, which doesn’t preserve the same consistency level as Bizur and ZooKeeper do.

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

Will you release binaries or it's gonna be a pure cloud solution like DocumentDB or DynamoDB?

comment 9y ago · link · parent

Even if we focus on 120k writes and ignore the low transaction number then it's still an average result. They use c3.4xlarge to run 5 shards each with 3 replication factor. It's 1500 writes per core (120k / (5*16)). Etcd easily does 5227 writes (I believe it can do even more) on "Standard DS12 v2" so it's 1306 per core which is very similar.

comment 9y ago · link · parent

With the cloud version, it's impossible to run jepsen-like tests to validate consistency and to observe cluster's behavior when the network is unstable and nodes tend to crush.

comment 9y ago · link · parent

Is it possible to download fauna to play with it on my own?
123