Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve logging #5387

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you discovered if all that logging was justified? Is this normal that we created that many S3Storage?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was not unreasonable, but could be improved with caching, which is covered by #5377 (not sure if it completely resolves the issue)

*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
Loading