Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(meta): backward compatible with host when running in mem meta backend #7628

Merged
merged 1 commit into from
Jan 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 15 additions & 20 deletions src/meta/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,27 +141,22 @@ pub fn start(opts: MetaNodeOpts) -> Pin<Box<dyn Future<Output = ()> + Send>> {
let meta_addr = opts.host.unwrap_or_else(|| opts.listen_addr.clone());
let dashboard_addr = opts.dashboard_host.map(|x| x.parse().unwrap());
let prometheus_addr = opts.prometheus_host.map(|x| x.parse().unwrap());
let (meta_endpoint, backend) = match opts.backend {
Backend::Etcd => (
opts.meta_endpoint
.unwrap_or_else(|| format!("{}:{}", meta_addr, listen_addr.port())),
MetaStoreBackend::Etcd {
endpoints: opts
.etcd_endpoints
.split(',')
.map(|x| x.to_string())
.collect(),
credentials: match opts.etcd_auth {
true => Some((opts.etcd_username, opts.etcd_password)),
false => None,
},
let meta_endpoint = opts
.meta_endpoint
.unwrap_or_else(|| format!("{}:{}", meta_addr, listen_addr.port()));
let backend = match opts.backend {
Backend::Etcd => MetaStoreBackend::Etcd {
endpoints: opts
.etcd_endpoints
.split(',')
.map(|x| x.to_string())
.collect(),
credentials: match opts.etcd_auth {
true => Some((opts.etcd_username, opts.etcd_password)),
false => None,
},
),
Backend::Mem => (
opts.meta_endpoint
.unwrap_or_else(|| opts.listen_addr.clone()),
MetaStoreBackend::Mem,
),
},
Backend::Mem => MetaStoreBackend::Mem,
};

let max_heartbeat_interval =
Expand Down