Skip to content

Commit

Permalink
Removed metastore -> controlplane event flow via the EventBroker. (#3880
Browse files Browse the repository at this point in the history
)

The two internal actors are replaced by two internal states.

Their execution is not concurrent anymore,
but we the code and the flow is simplified and we avoid some race conditions.

The control plane is not getting the update notify signal through the
broker anymore.

The Notify RPC is entirely removed.

Most of the test in the indexer scheduler become Control plane tests.
  • Loading branch information
fulmicoton authored Oct 5, 2023
1 parent 3cc14f0 commit ce0ac1f
Show file tree
Hide file tree
Showing 11 changed files with 703 additions and 1,170 deletions.
9 changes: 9 additions & 0 deletions quickwit/quickwit-common/src/progress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
use std::sync::atomic::{AtomicU32, Ordering};
use std::sync::Arc;

use futures::Future;

/// Progress makes it possible to register some progress.
/// It is used in lieu of healthcheck.
///
Expand Down Expand Up @@ -83,6 +85,13 @@ impl Progress {
.fetch_max(ProgressState::Updated.into(), Ordering::Relaxed);
}

/// Executes a future in a protected zone.
pub async fn protect_future<Fut, T>(&self, future: Fut) -> T
where Fut: Future<Output = T> {
let _guard = self.protect_zone();
future.await
}

pub fn protect_zone(&self) -> ProtectedZoneGuard {
loop {
let previous_state: ProgressState = self.0.load(Ordering::SeqCst).into();
Expand Down
Loading

0 comments on commit ce0ac1f

Please sign in to comment.