--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.
Thanks Josiah for feedback!I've thought that my idea doesn't look good, but in client library's point of view I had no ideas other than these. :)Pipeline should let us reach higher throughput so I wish to add it.Surely I should document that users about to use pipeline with Redis Cluster should take care of those restrictions if we REALLY think it's OK to apply idea.
Your ideas completely make sense, but I afraid it can be done by client library side with not affecting user's intention.We could discuss WATCH - MULTI - EXEC pattern though seems like it could be complex.
Thanks again!ps. Actually I've implemented supporting Async (https://github.com/xetorthio/jedis/pull/713), but cannot apply it to Redis Cluster because of handling MOVED, ASK. I'm finding a way to handle this.
On Fri, Nov 14, 2014 at 4:13 PM, HeartSaVioR <kab...@gmail.com> wrote:Thanks Josiah for feedback!I've thought that my idea doesn't look good, but in client library's point of view I had no ideas other than these. :)Pipeline should let us reach higher throughput so I wish to add it.Surely I should document that users about to use pipeline with Redis Cluster should take care of those restrictions if we REALLY think it's OK to apply idea.The problem is that while you may want an async pipeline for better performance, you can't guarantee that the commands being executed won't destroy your data if performed in the wrong order. And if you can't guarantee that your data will be fine, you have to document with: WARNING: using async behavior on Redis cluster could cause incorrect execution and may destroy some of your data. But because most users won't read the documentation, when someone inevitably destroys their data, it will be *your* fault because you released a feature with known potential to destroy data.
At present, I do not believe that there is a method by which you can get asynchronous pipelines between your client and Redis cluster to guarantee sequential execution. If Redis cluster published events for key migrations (migration start, migration finish) in addition to shard migrations (which don't seem to exist, but which should at least have: shard starting migration from X to Y, shard finished migration from X to Y), you could substantially limit the potential exposure for data loss. The exposure is still nonzero, but it is at least limited to network latency and/or outgoing buffers (both of which I still think are scary).
Really though, this should be addressed on the Redis cluster side of things. There is a method that would guarantee correct execution, and would let async execution work correctly in the vast majority of situations. This first pass at a solution (as I describe it below) requires 1 new CLIENT sub-command with 1 argument that could be one of 3 values. You could probably cut it down to 2 different values ('yes' and 'no'), but I'm a fan of the Python zen, "Explicit is better than implicit".1. When a client connects and wants to send commands to Redis asynchronously, they call "CLIENT ASYNC yes" (until this is called, the below behaviors do not apply)2. If while executing commands, the server would return a MOVED or ASK response, the server marks the connection as 'always ask', which means that all commands executed from then return the ASK response3. To recover a connection from being in 'always ask' mode, the client would execute "CLIENT ASYNC reset", which puts the connection back into normal async mode as it was at the end of #1Assuming that your client didn't discard the commands that were sent (but failed due to MOVED/ASK), you can execute "CLIENT ASYNC reset", handle the re-execution of commands as you would if it wasn't async.To disable async client processing, which also clears the 'always ask' status, you would call "CLIENT ASYNC no".For many users, having an additional configuration option for "clients-default-to-async" that defaults to "no" might make sense, but I wouldn't suggest adding it simply because any client that wants async behavior can trivially add this one command as part of connection creation. Clients would perform this in the exact same way that they already use AUTH on connection creation.Now we just need to convince Salvatore that all async clients are currently broken in Redis Cluster and that this would solve the problem.
Your ideas completely make sense, but I afraid it can be done by client library side with not affecting user's intention.We could discuss WATCH - MULTI - EXEC pattern though seems like it could be complex.Doing WATCH/MULTI/EXEC can really only work if you batch commands together, waiting for the last group to finish executing before sending this group. It is definitely not ideal.
Your ideas completely make sense, but I afraid it can be done by client library side with not affecting user's intention.We could discuss WATCH - MULTI - EXEC pattern though seems like it could be complex.Doing WATCH/MULTI/EXEC can really only work if you batch commands together, waiting for the last group to finish executing before sending this group. It is definitely not ideal.Pipeline is based on batch, so it should make sense.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+unsubscribe@googlegroups.com.
--
To post to this group, send email to redi...@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to a topic in the Google Groups "Redis DB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/redis-db/4I0ELYnf3bk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to redis-db+unsubscribe@googlegroups.com.
Sorry Josiah, it's not async, but I've confused pipeline and batch.
Yes, it should be batch, not pipeline.
Btw, some commands inside of MULTI fails because of MOVED, it doesn't rollback successful commands, right?
You received this message because you are subscribed to a topic in the Google Groups "Redis DB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/redis-db/4I0ELYnf3bk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.