Open Serpentian opened 11 months ago
It looks like require('vshard.cfg')
catches a wrong version of the module: from the git clone rather than from the checked out old version.
I met a problem of this kind and, if I remember it correctly, it was around .rocks/cwd/system require
search paths priority. Maybe I did tarantoolctl rocks make
in the vshard directory or had some vshard version installed in /usr/share/tarantool
or in /.rocks
.
I hope it helps.
The following diff causes an error in
reload_evolution/storage.test.lua
:Diff
```diff diff --git a/test/lua_libs/util.lua b/test/lua_libs/util.lua index 3f435cc..dc1cd86 100644 --- a/test/lua_libs/util.lua +++ b/test/lua_libs/util.lua @@ -2,6 +2,7 @@ local fiber = require('fiber') local log = require('log') local fio = require('fio') local git = require('git_util') +local vcfg = require('vshard.cfg') local name_to_uuid = { storage_1_a = '8a274925-a26d-47fc-9e1b-af88ce939412', @@ -215,6 +216,23 @@ local function map_bucket_protection(test_run, cluster, value) [[vshard.storage.internal.is_bucket_protected = ...]], value) end +local function box_router_cfg(cfg, router) + local vcfg = require('vshard.cfg') + local vshard_cfg = vcfg.extract_vshard(cfg) + local box_cfg = vcfg.extract_box(cfg, {}) + box.cfg(box_cfg) + if router == nil then + -- Static router configuration + return vshard.router.cfg(vshard_cfg) + end + if type(router) == 'table' then + -- Named router reconfiguration + return router:cfg(vshard_cfg) + end + -- Named router creation + return vshard.router.new(router, vshard_cfg) +end + return { check_error = check_error, shuffle_masters = shuffle_masters, @@ -231,4 +249,5 @@ return { git_checkout = git_checkout, portable_error = portable_error, is_timeout_error = is_timeout_error, + box_router_cfg = box_router_cfg, } ```