Skip to content

Commit 2c7cb10

Browse files
committed
[ENH]: garbage collect forked collections
Add fetch lineage file operator Add list files at version operator Framework
1 parent 7e6889e commit 2c7cb10

11 files changed

+648
-203
lines changed

rust/blockstore/src/arrow/provider.rs

+6
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,12 @@ pub struct RootManager {
469469
prefetched_roots: Arc<parking_lot::Mutex<HashMap<Uuid, Duration>>>,
470470
}
471471

472+
impl std::fmt::Debug for RootManager {
473+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
474+
f.debug_struct("RootManager").finish()
475+
}
476+
}
477+
472478
impl RootManager {
473479
pub fn new(storage: Storage, cache: Box<dyn PersistentCache<Uuid, RootReader>>) -> Self {
474480
let cache: Arc<dyn PersistentCache<Uuid, RootReader>> = cache.into();

rust/garbage_collector/src/garbage_collector_component.rs

+9
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ use crate::{
66
types::CleanupMode,
77
};
88
use async_trait::async_trait;
9+
use chroma_blockstore::RootManager;
10+
use chroma_cache::nop::NopCache;
911
use chroma_config::{
1012
assignment::assignment_policy::AssignmentPolicy, registry::Registry, Configurable,
1113
};
@@ -38,6 +40,7 @@ pub(crate) struct GarbageCollector {
3840
disabled_collections: HashSet<CollectionUuid>,
3941
sysdb_client: SysDb,
4042
storage: Storage,
43+
root_manager: RootManager,
4144
dispatcher: Option<ComponentHandle<Dispatcher>>,
4245
system: Option<chroma_system::System>,
4346
assignment_policy: Box<dyn AssignmentPolicy>,
@@ -74,6 +77,7 @@ impl GarbageCollector {
7477
disabled_collections: HashSet<CollectionUuid>,
7578
sysdb_client: SysDb,
7679
storage: Storage,
80+
root_manager: RootManager,
7781
default_cleanup_mode: CleanupMode,
7882
tenant_mode_overrides: Option<HashMap<String, CleanupMode>>,
7983
assignment_policy: Box<dyn AssignmentPolicy>,
@@ -88,6 +92,7 @@ impl GarbageCollector {
8892
disabled_collections,
8993
sysdb_client,
9094
storage,
95+
root_manager,
9196
dispatcher: None,
9297
system: None,
9398
default_cleanup_mode,
@@ -134,10 +139,12 @@ impl GarbageCollector {
134139
let orchestrator = GarbageCollectorOrchestrator::new(
135140
collection.id,
136141
collection.version_file_path,
142+
None, // todo
137143
absolute_cutoff_time,
138144
self.sysdb_client.clone(),
139145
dispatcher.clone(),
140146
self.storage.clone(),
147+
self.root_manager.clone(),
141148
cleanup_mode,
142149
);
143150

@@ -368,6 +375,7 @@ impl Configurable<GarbageCollectorConfig> for GarbageCollector {
368375
let sysdb_config = SysDbConfig::Grpc(config.sysdb_config.clone());
369376
let sysdb_client = SysDb::try_from_config(&sysdb_config, registry).await?;
370377
let storage = Storage::try_from_config(&config.storage_config, registry).await?;
378+
let root_manager = RootManager::new(storage.clone(), Box::new(NopCache)); // todo
371379

372380
let mut disabled_collections = HashSet::new();
373381
for collection_id_str in config.disallow_collections.iter() {
@@ -393,6 +401,7 @@ impl Configurable<GarbageCollectorConfig> for GarbageCollector {
393401
disabled_collections,
394402
sysdb_client,
395403
storage,
404+
root_manager,
396405
config.default_mode,
397406
config.tenant_mode_overrides.clone(),
398407
assignment_policy,

0 commit comments

Comments
 (0)