

WAIT: synchronous replication for Redis - dctrwatson
http://antirez.com/news/66

======
dudus
I just love antirez blog. He's such a talented developer with passion and
patience to explain implementation details. Every time you read one of their
posts you are sure to learn something new.

------
dexcs
@antirez: What i'm missing now is a function on (n) slave that tells me
whether one is up to date or not.

Example:

1 - client 1 set foo,bar to node 1

2 - node 2 replicates the data

3 - client 2 set foo,baz to node 1

4 - node 2 replicates the data

What if a read (get foo) reaches node 2 between step 3 and 4? What's the
return value? "bar" or "baz"?

It would be nice if this kind of consistency can be done with redis...
however... great work!!

------
tbarbugli
seems like 2.8 brought lots of cool things to Redis users! About this specific
command, I have the feeling the client needs to know bit too much about the
current situation (eg. how many slaves are connected) to use and interpret the
outcome of WAIT. Would be cool if the client can wait until N/2 slaves or N
(where n is the amount of slaves connected to master) with knowing (or asking)
for the value of N

~~~
antirez
That sounds interesting indeed, however the semantical implications are
extremely complex, as slaves disconnect N/2+1 changes dynamically.

What it is possible to do however at least in the context of Redis Cluster is
to query for "CLUSTER NODES" and get the minimum number of slaves connected
for a given master, and use that to auto-configure the client.

For stand alone Redis instances there is no way to obtain the max number of
attached slaves, only the current number unfortunately.

EDIT: another possibility is that the master itself is configured with a
default value that is used when the client sends, for example, -1 as number of
requested replicas.

