Skip to content

Commit

Permalink
Add some logging statements
Browse files Browse the repository at this point in the history
  • Loading branch information
guilload committed May 8, 2024
1 parent 8c1ddfb commit e5578bd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
24 changes: 24 additions & 0 deletions quickwit/quickwit-indexing/src/actors/indexing_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,11 @@ impl IndexingService {
ctx: &ActorContext<Self>,
indexing_pipeline_ids: &[IndexingPipelineId],
) -> Result<Vec<IndexMetadata>, IndexingError> {
info!(
"fetching {} indexes metadata for indexing pipelines `{}`",
indexing_pipeline_ids.len(),
indexing_pipeline_ids.iter().join(", ")
);
let index_metadata_subrequests: Vec<IndexMetadataSubrequest> = indexing_pipeline_ids
.iter()
// Remove duplicate subrequests
Expand All @@ -399,15 +404,31 @@ impl IndexingService {
let indexes_metadata_request = IndexesMetadataRequest {
subrequests: index_metadata_subrequests,
};
info!(
"issuing request with {} subrequests: {:?}",
indexes_metadata_request.subrequests.len(),
indexes_metadata_request
);
let _protected_zone_guard = ctx.protect_zone();

let indexes_metadata_response = self
.metastore
.indexes_metadata(indexes_metadata_request)
.await?;
if !indexes_metadata_response.failures.is_empty() {
error!(
"received IndexesMetadataResponse with {} failures: {:?}",
indexes_metadata_response.failures.len(),
indexes_metadata_response.failures
);
}
let indexes_metadata = indexes_metadata_response
.deserialize_indexes_metadata()
.await?;
info!(
"received response with {} indexes metadata",
indexes_metadata.len(),
);
Ok(indexes_metadata)
}

Expand Down Expand Up @@ -550,6 +571,9 @@ impl IndexingService {
}
})
.collect();
if pipeline_ids_to_add.is_empty() {
return Ok(Vec::new());
}
self.spawn_pipelines(&pipeline_ids_to_add, ctx).await
}

Expand Down
2 changes: 1 addition & 1 deletion quickwit/quickwit-metastore/src/metastore/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ impl IndexMetadataResponseExt for IndexMetadataResponse {
}
}

/// Helper trait to build a `ListIndexesResponse` and deserialize its payload.
/// Helper trait to build a [`IndexesMetadataResponse`] and deserialize its payload.
#[async_trait]
pub trait IndexesMetadataResponseExt {
/// Creates a new `IndexesMetadataResponse` from a `Vec` of [`IndexMetadata`].
Expand Down

0 comments on commit e5578bd

Please sign in to comment.