Skip to content

Commit 46404f7

Browse files
committed
[CHORE]: Better error logging for rebuilds
1 parent 9fb5102 commit 46404f7

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
@@ -265,12 +265,15 @@ impl CompactionManager {
265265
let collections = match self.context.sysdb.get_collections(options).await {
266266
Ok(collections) => collections,
267267
Err(e) => {
268-
// TODO(tanujnay112): Propagate error up and then handle it there.
269-
tracing::error!("Failed to get collections in rebuild: {}", e);
268+
tracing::error!(
269+
"Rebuild failed at sysdb.get_collections for collection IDs {:?}: {}",
270+
collection_ids,
271+
e
272+
);
270273
return;
271274
}
272275
};
273-
let _ = collections
276+
let results = collections
274277
.iter()
275278
.filter_map(|collection| {
276279
match chroma_types::DatabaseName::new(collection.database.clone()) {
@@ -296,6 +299,25 @@ impl CompactionManager {
296299
.collect::<FuturesUnordered<_>>()
297300
.collect::<Vec<_>>()
298301
.await;
302+
303+
// Log results
304+
for (result, collection) in results.into_iter().zip(collections.iter()) {
305+
match result {
306+
Ok(_) => {
307+
tracing::info!(
308+
"Rebuild succeeded for collection {}",
309+
collection.collection_id
310+
);
311+
}
312+
Err(e) => {
313+
tracing::error!(
314+
"Rebuild failed for collection {}: {}",
315+
collection.collection_id,
316+
e
317+
);
318+
}
319+
}
320+
}
299321
}
300322

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

0 commit comments

Comments
 (0)