Skip to content

Commit 1880120

Browse files
authored
[DBG] Add temporary trace for filter argument (#4548)
## Description of changes _Summarize the changes made by this PR._ - Improvements & Bug fixes - Add temporary traces to log filter arguments. We suspect certain filters are not handled properly. - Add projection error variant for clarity - New functionality - N/A ## Test plan _How are these changes tested?_ - [ ] Tests pass locally with `pytest` for python, `yarn test` for js, `cargo test` for rust ## Documentation Changes _Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the [docs section](https://github.com/chroma-core/chroma/tree/main/docs/docs.trychroma.com)?_
1 parent 4f042b3 commit 1880120

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,11 @@ impl Operator<FilterInput, FilterOutput> for FilterOperator {
498498
async fn run(&self, input: &FilterInput) -> Result<FilterOutput, FilterError> {
499499
tracing::debug!("[{}]: {:?}", self.get_name(), input);
500500

501+
// NOTE: This is temporary traces to capture filter arguments
502+
// We suspect certain filters break the FTS algorithm
503+
// TODO: Remove this after the bug is found
504+
tracing::debug!("[DEBUG FILTER OPERATOR]: {:?}", self);
505+
501506
let record_segment_reader = match RecordSegmentReader::from_segment(
502507
&input.record_segment,
503508
&input.blockfile_provider,

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ pub enum ProjectionError {
7171
RecordSegment(#[from] Box<dyn ChromaError>),
7272
#[error("Error reading unitialized record segment")]
7373
RecordSegmentUninitialized,
74+
#[error("Error reading phantom record: {0}")]
75+
RecordSegmentPhantomRecord(u32),
7476
}
7577

7678
impl ChromaError for ProjectionError {
@@ -80,6 +82,7 @@ impl ChromaError for ProjectionError {
8082
ProjectionError::RecordReader(e) => e.code(),
8183
ProjectionError::RecordSegment(e) => e.code(),
8284
ProjectionError::RecordSegmentUninitialized => ErrorCodes::Internal,
85+
ProjectionError::RecordSegmentPhantomRecord(_) => ErrorCodes::Internal,
8386
}
8487
}
8588
}
@@ -153,7 +156,7 @@ impl Operator<ProjectionInput, ProjectionOutput> for ProjectionOperator {
153156
let record = reader
154157
.get_data_for_offset_id(*offset_id)
155158
.await?
156-
.ok_or(ProjectionError::RecordSegmentUninitialized)?;
159+
.ok_or(ProjectionError::RecordSegmentPhantomRecord(*offset_id))?;
157160
ProjectionRecord {
158161
id: record.id.to_string(),
159162
document: record

0 commit comments

Comments
 (0)