Skip to content

Commit 8ee38ba

Browse files
committed
[CHORE]: Better error logging for rebuilds
1 parent 3676846 commit 8ee38ba

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

rust/worker/src/compactor/compaction_manager.rs

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,15 @@ impl CompactionManager {
268268
let collections = match self.context.sysdb.get_collections(options).await {
269269
Ok(collections) => collections,
270270
Err(e) => {
271-
// TODO(tanujnay112): Propagate error up and then handle it there.
272-
tracing::error!("Failed to get collections in rebuild: {}", e);
271+
tracing::error!(
272+
"Rebuild failed at sysdb.get_collections for collection IDs {:?}: {}",
273+
collection_ids,
274+
e
275+
);
273276
return;
274277
}
275278
};
276-
let _ = collections
279+
let results = collections
277280
.iter()
278281
.filter_map(|collection| {
279282
match chroma_types::DatabaseName::new(collection.database.clone()) {
@@ -299,6 +302,25 @@ impl CompactionManager {
299302
.collect::<FuturesUnordered<_>>()
300303
.collect::<Vec<_>>()
301304
.await;
305+
306+
// Log results
307+
for (result, collection) in results.into_iter().zip(collections.iter()) {
308+
match result {
309+
Ok(_) => {
310+
tracing::info!(
311+
"Rebuild succeeded for collection {}",
312+
collection.collection_id
313+
);
314+
}
315+
Err(e) => {
316+
tracing::error!(
317+
"Rebuild failed for collection {}: {}",
318+
collection.collection_id,
319+
e
320+
);
321+
}
322+
}
323+
}
302324
}
303325

304326
#[instrument(name = "CompactionManager::purge_dirty_log", skip(ctx))]

0 commit comments

Comments
 (0)