Closed vol0n closed 11 months ago
Thank you for digging! The issue is blocked by https://github.com/tarantool/tarantool/issues/9131
Can we just always use box.func
? netbox.self
is used because in the old times it was the only way to call a local function without requiring its Lua or C module.
Sure, we can. But it doesn't change the fact, that netbox.self
doesn't work.
It does mean that the ticket is not blocked though. I suggest we drop the 'blocked' label.
Problem
We have a c stored procedure
execute
, earlier we called it via replicaset api like this:Now we've started to use
map_callrw
router api, which gives us an error saying it is not defined:The function was created like this:
And it is callable through box.func api:
Tarantool version: 2.11.0 Vshard version: latest
Hint
After digging a bit in the code I found that
map_callrw(f, args)
callsstorage_map(f, args)
, the latter callsnet.box.self.call(f, args)
and this internally in tarantool callsbox_lua_find
which tries to find the function in lua globals.On the other hand,
replica:callbre(f, args)
callsnet.box.conn.call
, the latter first checks whether the function is in cache and only then usesbox_lua_find
.So the problem seems to be in using
self.call
insidestorage_map