diff --git a/quickwit/Cargo.lock b/quickwit/Cargo.lock index d08f2a51a47..09388dfadf2 100644 --- a/quickwit/Cargo.lock +++ b/quickwit/Cargo.lock @@ -1244,7 +1244,7 @@ dependencies = [ [[package]] name = "chitchat" version = "0.8.0" -source = "git+https://github.com/quickwit-oss/chitchat.git?rev=31f8d02#31f8d029984c26d182e6a7f6e91e65dd24db6ac5" +source = "git+https://github.com/quickwit-oss/chitchat.git?rev=fa59b4c#fa59b4c8b5d15638274d3dc4f3037f2163f790aa" dependencies = [ "anyhow", "async-trait", diff --git a/quickwit/Cargo.toml b/quickwit/Cargo.toml index d4294f09146..adc4966ee83 100644 --- a/quickwit/Cargo.toml +++ b/quickwit/Cargo.toml @@ -90,7 +90,7 @@ base64 = "0.21" bytes = { version = "1", features = ["serde"] } bytesize = { version = "1.3.0", features = ["serde"] } bytestring = "1.3.0" -chitchat = { git = "https://github.com/quickwit-oss/chitchat.git", rev = "31f8d02" } +chitchat = { git = "https://github.com/quickwit-oss/chitchat.git", rev = "fa59b4c" } chrono = { version = "0.4", default-features = false, features = [ "clock", "std", diff --git a/quickwit/quickwit-cluster/src/cluster.rs b/quickwit/quickwit-cluster/src/cluster.rs index 36691a8e7bb..5f379e909e1 100644 --- a/quickwit/quickwit-cluster/src/cluster.rs +++ b/quickwit/quickwit-cluster/src/cluster.rs @@ -49,10 +49,10 @@ use crate::member::{ use crate::metrics::spawn_metrics_task; use crate::{ClusterChangeStream, ClusterNode}; -const MARKED_FOR_DELETION_GRACE_PERIOD: usize = if cfg!(any(test, feature = "testsuite")) { - 100 // ~ HEARTBEAT * 100 = 2.5 seconds. +const MARKED_FOR_DELETION_GRACE_PERIOD: Duration = if cfg!(any(test, feature = "testsuite")) { + Duration::from_millis(2_500) // 2.5 secs } else { - 5_000 // ~ HEARTBEAT * 5_000 ~ 4 hours. + Duration::from_secs(3_600 * 2) // 2 hours. }; // An indexing task key is formatted as @@ -133,6 +133,10 @@ impl Cluster { failure_detector_config, gossip_interval, marked_for_deletion_grace_period: MARKED_FOR_DELETION_GRACE_PERIOD, + extra_liveness_predicate: Some(Box::new(|node_state: &NodeState| { + node_state.contains_key(ENABLED_SERVICES_KEY) + && node_state.contains_key(GRPC_ADVERTISE_ADDR_KEY) + })), }; let chitchat_handle = spawn_chitchat( chitchat_config,