Description
This issue was first raised in Redis community redis/redis#11780, it is a major miss from Redis 7.0, but haven't got a solution. I believe we still need to discuss this issue in this new project, perhaps as a part of new cluster architecture.
The problem:
Let's say:
- a slot, which includes
key1
, is migrated from node A to node B, operated by client1 - in node A a function
myfunc
is already loaded, but in node B it is not
Now client2, that used to handle key1
in node A, sends FCALL myfunc 1 key1
to node A, which will be redirected to node B, will then get an unexpected error.
Or if node B also has a function myfunc
but it does different things, client2 may trigger unexpected results.
Some thoughts:
1.Should functions be migrated together with slots?
Maybe not. This may overwrite the libraries already loaded in the nodes importing slots. But we may set a version to each library so that we can always choose to keep the latest one.
2.Can functions be broadcasted to all nodes?
May cause confict between nodes. And when adding new nodes we need to have a full synchronization.