> On 26 May 2015, at 01:28, Josiah Carlson <
josiah....@gmail.com> wrote:
>
> If you call EVAL or EVALSHA, and one of the keys that you pass as part of the KEYS arguments to the Lua script has been migrated, you will be informed of that fact through a -MOVED or -ASK redirection. Go here:
http://redis.io/topics/cluster-spec and search for "migrating". When you get the -ASK redirection, you then hit the new machine with an ASKING call, see the section on "ASK redirection".
>
> That is the documentation, I haven't had the chance to touch Redis Cluster yet, so your actual experience may vary.
Hi Josiah,
I'm aware of that part of the documentation in the spec. Let's assume everything works as you described in my original example:
1. Some client sends a EVAL command hitting K1 and K2 to instance X.
2. Instance X receives the command and notices that K1 and K2 map to the same slot S. S is owned by instance X, however S is being migrated to instance Y and one of the keys (K1) has already being migrated. The other key (K2) is still in instance X.
3. X replies with an -ASK redirection to the client.
4. The client sends again the EVAL command, now to instance Y, and using a pipeline in order to include the ASK command.
5. Instance Y receives the command but... ¿what's going to happen when the script tries to read / write key K2? That key has not been migrated yet to Y.
I've not been able to find anything in the documentation explaining the expected behaviour in this case:
- Maybe everything is 'magical' and LUA commands accessing to K2 will be forwarded to X but I don't expect that. That will break atomic execution of LUA scripts.
- Maybe LUA commands accessing to K2 will get a -MOVED redirection which will break the script execution. If so I guess Redis Cluster will not support this scenario and the script will be broken during the migration of the slot.
Thanks,
--
Carlos Abalde