Skip to content
Open
Show file tree
Hide file tree
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
21 changes: 18 additions & 3 deletions quickwit/quickwit-control-plane/src/control_plane.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ use quickwit_metastore::{CreateIndexRequestExt, CreateIndexResponseExt, IndexMet
use quickwit_proto::control_plane::{
AdviseResetShardsRequest, AdviseResetShardsResponse, ControlPlaneError, ControlPlaneResult,
GetOrCreateOpenShardsRequest, GetOrCreateOpenShardsResponse, GetOrCreateOpenShardsSubrequest,
SwapIndexingPipelinesRequest, SwapIndexingPipelinesResponse,
};
use quickwit_proto::indexing::ShardPositionsUpdate;
use quickwit_proto::metastore::{
Expand Down Expand Up @@ -353,7 +354,7 @@ impl ControlPlane {
let physical_indexing_plan: Vec<JsonValue> = self
.indexing_scheduler
.observable_state()
.last_applied_physical_plan
.current_targetted_physical_plan
.map(|plan| {
plan.indexing_tasks_per_indexer()
.iter()
Expand Down Expand Up @@ -953,6 +954,20 @@ impl Handler<AdviseResetShardsRequest> for ControlPlane {
}
}

#[async_trait]
impl Handler<SwapIndexingPipelinesRequest> for ControlPlane {
type Reply = ControlPlaneResult<SwapIndexingPipelinesResponse>;

async fn handle(
&mut self,
request: SwapIndexingPipelinesRequest,
_ctx: &ActorContext<Self>,
) -> Result<Self::Reply, ActorExitStatus> {
let response = self.indexing_scheduler.swap_pipelines(request);
Ok(response)
}
}

#[async_trait]
impl Handler<LocalShardsUpdate> for ControlPlane {
type Reply = ControlPlaneResult<()>;
Expand Down Expand Up @@ -1906,7 +1921,7 @@ mod tests {
control_plane_mailbox.ask(Observe).await.unwrap();
let last_applied_physical_plan = control_plane_obs
.indexing_scheduler
.last_applied_physical_plan
.current_targetted_physical_plan
.unwrap();
let indexing_tasks = last_applied_physical_plan
.indexing_tasks_per_indexer()
Expand Down Expand Up @@ -1937,7 +1952,7 @@ mod tests {
control_plane_mailbox.ask(Observe).await.unwrap();
let last_applied_physical_plan = control_plane_obs
.indexing_scheduler
.last_applied_physical_plan
.current_targetted_physical_plan
.unwrap();
let indexing_tasks = last_applied_physical_plan
.indexing_tasks_per_indexer()
Expand Down
Loading
Loading