From d71dfcf085903a174ff00401c3a9d1c8b94b574b Mon Sep 17 00:00:00 2001 From: Paul Masurel Date: Fri, 24 May 2024 23:36:25 +0900 Subject: [PATCH] Fix consistency between CP/metastore on auto-create index. (#5030) Metastore errors that are not necessarily aborted require us to restart the CP actor to keep it in sync. Closes #5014 --- quickwit/quickwit-control-plane/src/control_plane.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/quickwit/quickwit-control-plane/src/control_plane.rs b/quickwit/quickwit-control-plane/src/control_plane.rs index 6e577159a7e..51676895363 100644 --- a/quickwit/quickwit-control-plane/src/control_plane.rs +++ b/quickwit/quickwit-control-plane/src/control_plane.rs @@ -239,7 +239,7 @@ impl ControlPlane { &mut self, subrequests: &[GetOrCreateOpenShardsSubrequest], progress: &Progress, - ) -> ControlPlaneResult<()> { + ) -> MetastoreResult<()> { if !self.cluster_config.auto_create_indexes { return Ok(()); } @@ -777,11 +777,11 @@ impl Handler for ControlPlane { request: GetOrCreateOpenShardsRequest, ctx: &ActorContext, ) -> Result { - if let Err(control_plane_error) = self + if let Err(metastore_error) = self .auto_create_indexes(&request.subrequests, ctx.progress()) .await { - return Ok(Err(control_plane_error)); + return convert_metastore_error(metastore_error); } let response = match self .ingest_controller