Skip to content
Merged
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
18 changes: 9 additions & 9 deletions quickwit/Cargo.lock

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

2 changes: 1 addition & 1 deletion quickwit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ quickwit-serve = { path = "quickwit-serve" }
quickwit-storage = { path = "quickwit-storage" }
quickwit-telemetry = { path = "quickwit-telemetry" }

tantivy = { git = "https://github.com/quickwit-oss/tantivy/", rev = "e843c71", default-features = false, features = [
tantivy = { git = "https://github.com/quickwit-oss/tantivy/", rev = "80f5f1e", default-features = false, features = [
"lz4-compression",
"mmap",
"quickwit",
Expand Down
43 changes: 31 additions & 12 deletions quickwit/quickwit-indexing/src/actors/merge_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ use tantivy::index::SegmentId;
use tantivy::tokenizer::TokenizerManager;
use tantivy::{DateTime, Directory, Index, IndexMeta, IndexWriter, SegmentReader};
use tokio::runtime::Handle;
use tracing::{debug, info, instrument, warn};
use tracing::{debug, error, info, instrument, warn};

use crate::actors::Packager;
use crate::controlled_directory::ControlledDirectory;
Expand Down Expand Up @@ -90,16 +90,35 @@ impl Handler<MergeScratch> for MergeExecutor {
let start = Instant::now();
let merge_task = merge_scratch.merge_task;
let indexed_split_opt: Option<IndexedSplit> = match merge_task.operation_type {
MergeOperationType::Merge => Some(
self.process_merge(
merge_task.merge_split_id.clone(),
merge_task.splits.clone(),
merge_scratch.tantivy_dirs,
merge_scratch.merge_scratch_directory,
ctx,
)
.await?,
),
MergeOperationType::Merge => {
let merge_res = self
.process_merge(
merge_task.merge_split_id.clone(),
merge_task.splits.clone(),
merge_scratch.tantivy_dirs,
merge_scratch.merge_scratch_directory,
ctx,
)
.await;
match merge_res {
Ok(indexed_split) => Some(indexed_split),
Err(err) => {
// A failure in a merge is a bit special.
//
// Instead of failing the pipeline, we just log it.
// The idea is to limit the risk associated with a potential split of death.
//
// Such a split is now not tracked by the merge planner and won't undergo a
// merge until the merge pipeline is restarted.
//
// With a merge policy that marks splits as mature after a day or so, this
// limits the noise associated to those failed
// merges.
error!(task=?merge_task, err=?err, "failed to merge splits");
return Ok(());
}
}
}
MergeOperationType::DeleteAndMerge => {
assert_eq!(
merge_task.splits.len(),
Expand Down Expand Up @@ -540,7 +559,7 @@ impl MergeExecutor {

debug!(segment_ids=?segment_ids,"merging-segments");
// TODO it would be nice if tantivy could let us run the merge in the current thread.
index_writer.merge(&segment_ids).wait()?;
index_writer.merge(&segment_ids).await?;

Ok(output_directory)
}
Expand Down