-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Recently, I had to investigate an issue with server failovers which cleared the SHA-1
hash cache and prevented me from evaluating back-end cached lua scripts because the hashes themselves did not exist on the server. The StackExchange.Redis
version was quite outdated and did not feature the improvements in v2.6.66
which change how loaded scripts were evaluated.
Instead of sending the . However, I was trying to replicate the issue we experienced in an isolated environment using a docker container. I was not able to reproduce the initial issue after I updated the library, whenever I rebooted the container. The SHA-1
hash value, now the script itself is evaluated which works for our use caseXML
documentation for the LoadedLuaScript::Evaluate()
& LoadedLuaScript::EvaluateAsync()
do not reference the new behavior and mislead me. Finally, I had to take a look at the source code in order to understand why after a SCRIPT FLUSH [SYNC|ASYNC]
command, the loaded lua scripts were able to be evaluated even though the hashes were not present on the server.
ℹ️ Update: After looking through the command logs with MONITOR
, seems like if a previously loaded script's hash is not found on the server - it will be reloaded with SCRIPT LOAD
. However, I'm seeing that it's evaluated with the EVAL
command on the first evaluation, after the reload operation. Any subsequent evaluation uses EVALSHA
.