I think that `evalsha -> error -> eval` is the most "universal" solution of them all. Mostly because it enables client NOT to remember "did we load script into Redis?" On a side note -- you are not required to call `script load` after `evalsha` error -- Redis will "load" script after first `eval` invocation, all you need to do is calculate SHA1 of your script yourself.
`evalsha` in a `multi/exec` is a problem though, but there are couple of possible solutions:
1. all keys of `multi/exec` should belong to one master, so you could determine that master and check `script exists` specifically for that and only that node right before start of `multi`;
2. incorporate all your `multi/exec` commands into script;
3. check if script really needs to be run in `multi/exec`. :)
пятница, 4 декабря 2015 г., 16:01:08 UTC+3 пользователь Dorian B. написал: