Skip to content
Snippets Groups Projects
Commit 1eac4eaf authored by Georgy Moshkin's avatar Georgy Moshkin :speech_balloon:
Browse files

fix: vshard used to break box.cfg.listen value

parent 37b0990f
No related branches found
No related tags found
No related merge requests found
Pipeline #32786 canceled
......@@ -22,11 +22,12 @@ crate::define_rpc_request! {
node.wait_index(req.applied, req.timeout)?;
node.status().check_term(req.term)?;
let cfg = node.storage.properties.target_vshard_config()?;
crate::tlog!(Debug, "vshard config: {cfg:?}");
let lua = ::tarantool::lua_state();
let mut cfg = node.storage.properties.target_vshard_config()?;
cfg.listen = Some(lua.eval("return box.info.listen")?);
crate::tlog!(Debug, "vshard config: {cfg:?}");
if !req.do_reconfigure {
if let Some(tlua::True) = lua.eval("return pico._vshard_is_configured")? {
return Ok(Response {});
......
......@@ -14,6 +14,13 @@ use std::collections::HashMap;
pub struct VshardConfig {
sharding: HashMap<String, ReplicasetSpec>,
discovery_mode: DiscoveryMode,
/// This field is not stored in the global storage, instead
/// it is set right before the config is passed into vshard.*.cfg,
/// otherwise vshard will override it with an incorrect value.
#[serde(skip_serializing_if="Option::is_none")]
#[serde(default)]
pub listen: Option<String>,
}
#[rustfmt::skip]
......@@ -110,6 +117,7 @@ impl VshardConfig {
}
Self {
listen: None,
sharding,
discovery_mode: DiscoveryMode::On,
}
......
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