Skip to content

Commit

Permalink
improve logging (#5387)
Browse files Browse the repository at this point in the history
log actual index_id patterns that are queried on leaf nodes
reduce log spam
  • Loading branch information
PSeitz authored Sep 10, 2024
1 parent 4ed7995 commit 674f386
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
14 changes: 9 additions & 5 deletions quickwit/quickwit-config/src/storage_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.

use std::ops::Deref;
use std::sync::OnceLock;
use std::{env, fmt};

use anyhow::ensure;
Expand Down Expand Up @@ -370,11 +371,14 @@ impl S3StorageConfig {
}

pub fn force_path_style_access(&self) -> Option<bool> {
let force_path_style_access = get_bool_from_env(
"QW_S3_FORCE_PATH_STYLE_ACCESS",
self.force_path_style_access,
);
Some(force_path_style_access)
static FORCE_PATH_STYLE: OnceLock<Option<bool>> = OnceLock::new();
*FORCE_PATH_STYLE.get_or_init(|| {
let force_path_style_access = get_bool_from_env(
"QW_S3_FORCE_PATH_STYLE_ACCESS",
self.force_path_style_access,
);
Some(force_path_style_access)
})
}
}

Expand Down
5 changes: 3 additions & 2 deletions quickwit/quickwit-proto/protos/quickwit/search.proto
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,9 @@ message SplitSearchError {
/// A LeafSearchRequest can span multiple indices.
///
message LeafSearchRequest {
// Search request. This is a perfect copy of the original search request,
// that was sent to root apart from the start_offset & max_hits params.
// Search request. This is a perfect copy of the original search request
// that was sent to root apart from the start_offset, max_hits params and index_id_patterns.
// index_id_patterns contains the actual index ids queried on that leaf.
SearchRequest search_request = 1;

// List of leaf requests, one per index.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions quickwit/quickwit-search/src/root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1563,6 +1563,7 @@ pub fn jobs_to_leaf_request(
let mut search_request_for_leaf = request.clone();
search_request_for_leaf.start_offset = 0;
search_request_for_leaf.max_hits += request.start_offset;
search_request_for_leaf.index_id_patterns = Vec::new();

let mut leaf_search_request = LeafSearchRequest {
search_request: Some(search_request_for_leaf),
Expand All @@ -1575,6 +1576,12 @@ pub fn jobs_to_leaf_request(
// Group jobs by index uid, as the split offsets are relative to the index.
group_jobs_by_index_id(jobs, |job_group| {
let index_uid = &job_group[0].index_uid;
leaf_search_request
.search_request
.as_mut()
.unwrap()
.index_id_patterns
.push(index_uid.index_id.to_string());
let search_index_meta = search_indexes_metadatas.get(index_uid).ok_or_else(|| {
SearchError::Internal(format!(
"received job for an unknown index {index_uid}. it should never happen"
Expand Down

0 comments on commit 674f386

Please sign in to comment.