Skip to content

Commit

Permalink
Manual compaction must specify collection id
Browse files Browse the repository at this point in the history
  • Loading branch information
Sicheng Pan committed Jan 21, 2025
1 parent 77b5ab5 commit b9521bc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion idl/chromadb/proto/compactor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ message CollectionIds {
}

message CompactionRequest {
optional CollectionIds ids = 1;
CollectionIds ids = 1;
}

message CompactionResponse {
Expand Down
2 changes: 1 addition & 1 deletion rust/worker/src/compactor/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ pub struct ScheduledCompactionMessage {}
#[derive(Clone, Debug)]
pub struct OneOffCompactionMessage {
#[allow(dead_code)]
pub collection_ids: Option<Vec<CollectionUuid>>,
pub collection_ids: Vec<CollectionUuid>,
}
12 changes: 5 additions & 7 deletions rust/worker/src/utils/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,11 @@ impl TryFrom<chroma_proto::CompactionRequest> for OneOffCompactionMessage {
Ok(Self {
collection_ids: value
.ids
.map(|ids| {
ids.ids
.into_iter()
.map(|id| CollectionUuid::from_str(&id))
.collect::<Result<_, _>>()
})
.transpose()
.ok_or(ConversionError::DecodeError)?
.ids
.into_iter()
.map(|id| CollectionUuid::from_str(&id))
.collect::<Result<_, _>>()
.map_err(|_| ConversionError::DecodeError)?,
})
}
Expand Down

0 comments on commit b9521bc

Please sign in to comment.