-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Description
Expected behavior
functionLoadReplace(script) using a JedisCluster should load the function without errors.
The script is a dummy script:
#!lua name=mylib
redis.register_function({
function_name = 'mylib',
callback = function() return 0 end,
description = "hi how are you"
})
Using Jedis 5.2.0
Actual behavior
functionLoadReplace throws a JedisBroadcastException error:
Caused by: redis.clients.jedis.exceptions.JedisBroadcastException: A failure occurred while broadcasting the command.
at redis.clients.jedis.executors.ClusterCommandExecutor.broadcastCommand(ClusterCommandExecutor.java:47) ~[jedis-5.2.0.jar:?]
at redis.clients.jedis.UnifiedJedis.broadcastCommand(UnifiedJedis.java:312) ~[jedis-5.2.0.jar:?]
at redis.clients.jedis.UnifiedJedis.checkAndBroadcastCommand(UnifiedJedis.java:325) ~[jedis-5.2.0.jar:?]
at redis.clients.jedis.UnifiedJedis.functionLoadReplace(UnifiedJedis.java:3552) ~[jedis-5.2.0.jar:?]
Checking in the cluster the function does exist, so I understand that in some node the load was successful, but failed in the broadcast.
This happens for both functions that write to the ddbb and for functions with the 'no-write' flag, so It would seem it is not because of trying to upload the function to a replica node.
Doing functionLoadReplace on each of the nodes of the cluster using a Jedis resource does work, both for replicas and masters, with or without the no-write
flag.