Skip to content
Snippets Groups Projects
Commit 7ad00c2c authored by Dmitry Rodionov's avatar Dmitry Rodionov
Browse files

fix: vshard cluster already bootstrapped error after timeout

If initial call to vshard.router.bootstrap failed with taimeout then
following calls return cluster already bootstrapped error. Make
proc_sharding_bootstrap treat this error as successful bootstrap.

Close: https://git.picodata.io/picodata/picodata/picodata/-/issues/751
parent 6afdac9a
No related branches found
No related tags found
1 merge request!1131fix: vshard cluster already bootstrapped error after timeout
......@@ -98,7 +98,17 @@ pub mod bootstrap {
let lua = tarantool::lua_state();
let (ok, err): (Option<tlua::True>, Option<tlua::ToString>) =
lua.eval("return vshard.router.bootstrap()")?;
lua.eval("
local lerror = require('vshard.error')
local ok, err = vshard.router.bootstrap()
if not ok and type(err) == 'table' then
if err.code == lerror.code.NON_EMPTY then
return true
end
end
return ok, err
")?;
match (ok, err) {
(Some(tlua::True), None) => {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment