antirez/redis — pull request #1689 by yossigo (2014-04-15 18:16:59+00:00)
Title: Replicate readonly scripts with SCRIPT LOAD.

There is an inconsistency in the way read-only scripts are replicated:
- On EVAL, a script won't be replicated if it's read-only.
- On EVALSHA it will always be replicated unless it's already in the replication cache (i.e. known to be replicated).

In the following sequence, the EVALSHA on the slave fails:
```
master> EVAL
slave> EVALSHA
```

In the following sequence, it will succeed:
```
master> EVAL
master> EVALSHA
slave> EVALSHA
```

The proposed solution is to simply use SCRIPT LOAD on read-only EVAL if the script was not previously cached.