All Questions
472
questions
0
votes
0
answers
21
views
redis lua script can't call on global
local function get_cur_time()
local current_time = redis.call('TIME')[1]
local current_minute_start = math.floor(current_time / 60) * 60
return current_minute_start
end
-- add below line ...
0
votes
0
answers
40
views
Does executing a Lua script in Redis block the entire Redis server or just the database being accessed?
Details:
Atomic Operations: I understand that Lua scripts in Redis are executed atomically. However, I need clarification on whether the atomicity affects only the Redis database being accessed by the ...
0
votes
1
answer
28
views
How to modify existing and new string index in Redis?
I am storing strings and numbers in Redis.
I use basic key value stores to keep track of the current color value.
DATA:color:ID1 = red
DATA:color:ID2 = red
DATA:color:ID3 = red
DATA:color:ID4 = blue
...
0
votes
1
answer
30
views
Redis eviction policy using lua script
I have a lot of data in Redis like
User_DB_1:<user_id> , User_Main:<user_id>, Skills_DB_1:<user_id>
I set the maxmemory to 50MB and write a lua script and run it in Redis that lua ...
1
vote
1
answer
43
views
Plot with Grafana (timeseries panel) only one "field" of a Redis Stream
I've some data in Redis streams
which look like
XRANGE trades-BINANCE-BTC-USDT 1711915630000 1711915637000
1) 1) "1711915630040-0"
2) 1) "exchange"
2) "BINANCE"
...
0
votes
0
answers
45
views
lua script from java (io-lettuce-core)
I am trying to run a Lua script from lettuce like this that does an hgetall command on a remote Redis:
private static String SCRIPT_CONS = "local hgetallkeys = function(key)" +"\n" ...
1
vote
2
answers
88
views
Lua function in Redis - error attempt to compare nil with number
I've a Redis cluster v7.x with 3 masters each having a slave.
I've defined a Lua function as following:
local keyGet = redis.call('GET', timeSlotKey)
local currentValue = 0
if keyGet ~= nil then
...
1
vote
0
answers
16
views
Get Lua function definition stored in Redis
Is there any way I can see the source of a function stored in the Redis server? The function has been written in the Lua language.
0
votes
1
answer
68
views
Access data structure on different master node from within a Redis function written in Lua
I've a Redis cluster v7.x with 3 masters, each having 1 slave.
A function myFunction written in Lua scripting is loaded in all the 3 masters. The function doesn't need any keys, but some args.
Is it ...
0
votes
1
answer
133
views
Redis Lua function call failing with CROSSSLOT error
I have a Redis 7.x cluster with 3 master nodes running on ports 7000, 7001, 7002. Each master has 1 slave/replica.
I am trying to load and run this Lua based function:
#!lua name=paramsLogLib
local ...
0
votes
1
answer
78
views
print call issue in Lua based function
I have a Redis 7.x cluster with 3 master nodes running on ports 7000, 7001, 7002. Each master has 1 slave/replica.
I am trying to load and run this Lua based function:
#!lua name=printTestLib
local ...
0
votes
1
answer
136
views
Redis Function not found
My setup is a 3 masters, 3 slaves Redis cluster, version 7.x.
I created a simple Lua based function as:
#!lua name=loggerLib
local function logMsg(keys, args)
redis.log(redis.LOG_NOTICE, 'Hello!');...
0
votes
1
answer
62
views
Lua Set in Redis is not working as expected
I am new to Lua scripting and facing issues while creating Set in Lua. I am trying to store unique elements in Lua Set using below code but it isn't working as expected.
local function test()
local ...
1
vote
1
answer
105
views
why can't get value from lua in redis
I use lua to save. the data to redis.
redis.call('SET', KEYS[1], cjson.encode(ARGV[1]))
ARGV1 is the go struct.
The go code to pass the struct to redis lua
here is my struct looks like
type InviteInfo ...
1
vote
2
answers
285
views
If a executable redis's lua script fail to return value to client (java application), is that transaction rolled back or not?
Here is my Lua script.
local field = ARGV[1]
local amount = ARGV[2]
local newAmount = redis.call("HINCRBYFLOAT", key, field, amount)
return newAmount
I have this lua script in my java ...