Skip to content

Commit 851511a

Browse files
committed
fix changes after rebase
1 parent cffe2a3 commit 851511a

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

rust/worker/src/execution/operators/apply_log_to_segment_writer.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use std::sync::Arc;
2-
1+
use super::materialize_logs::MaterializeLogOutput;
32
use crate::execution::operator::Operator;
43
use crate::segment::metadata_segment::MetadataSegmentError;
54
use crate::segment::record_segment::ApplyMaterializedLogError;
@@ -9,11 +8,10 @@ use crate::segment::SegmentWriter;
98
use async_trait::async_trait;
109
use chroma_error::ChromaError;
1110
use chroma_error::ErrorCodes;
11+
use std::sync::Arc;
1212
use thiserror::Error;
1313
use tracing::Instrument;
1414

15-
use super::materialize_logs::MaterializeLogOutput;
16-
1715
#[derive(Error, Debug)]
1816
pub enum ApplyLogToSegmentWriterOperatorError {
1917
#[error("Preparation for log materialization failed {0}")]
@@ -88,7 +86,8 @@ impl<Writer: SegmentWriter + Send + Sync + Clone>
8886
.segment_writer
8987
.apply_materialized_log_chunk(materialized_chunk.clone())
9088
.instrument(tracing::trace_span!(
91-
"Apply materialized logs to record segment"
89+
"Apply materialized logs",
90+
segment = input.segment_writer.get_name()
9291
))
9392
.await
9493
{

rust/worker/src/execution/orchestration/compact.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,10 @@ impl CompactOrchestrator {
353353
match self.dispatcher.send(task, Some(Span::current())).await {
354354
Ok(_) => (),
355355
Err(e) => {
356-
tracing::error!("Error dispatching writers for compaction {:?}", e);
356+
tracing::error!(
357+
"Error dispatching apply log to segment writer task: {:?}",
358+
e
359+
);
357360
panic!(
358361
"Invariant violation. Somehow the dispatcher receiver is dropped. Error: {:?}",
359362
e
@@ -671,7 +674,14 @@ impl Handler<TaskResult<MaterializeLogOutput, MaterializeLogOperatorError>>
671674
let materialized_result = Arc::new(materialized_result);
672675

673676
let (record_segment_writer, hnsw_segment_writer, metadata_segment_writer) =
674-
self.get_segment_writers().await.unwrap(); // todo
677+
match self.get_segment_writers().await {
678+
Ok(writers) => writers,
679+
Err(e) => {
680+
tracing::error!("Error getting segment writers: {:?}", e);
681+
terminate_with_error(self.result_channel.take(), e, ctx);
682+
return;
683+
}
684+
};
675685

676686
self.dispatch_apply_log_to_segment_writer_task(
677687
record_segment_writer,

0 commit comments

Comments
 (0)