Skip to content

Commit e33a3c4

Browse files
committed
[ENH]: garbage collector v2 orchestrator (supports forking)
1 parent fc1cd49 commit e33a3c4

File tree

12 files changed

+1957
-116
lines changed

12 files changed

+1957
-116
lines changed

Cargo.lock

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/blockstore/src/test_utils/sparse_index_test_utils.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ use uuid::Uuid;
2121
/// * `Result<Uuid, Box<dyn ChromaError>>` - The UUID of the created sparse index file
2222
pub async fn create_test_sparse_index(
2323
storage: &Storage,
24+
root_id: Uuid,
2425
block_ids: Vec<Uuid>,
2526
prefix: Option<String>,
2627
) -> Result<Uuid, Box<dyn ChromaError>> {
@@ -43,7 +44,6 @@ pub async fn create_test_sparse_index(
4344
sparse_index.set_count(block_ids[0], 1)?;
4445

4546
// Create and save the sparse index file
46-
let root_id = Uuid::new_v4();
4747
let root_writer = RootWriter::new(Version::V1_1, root_id, sparse_index);
4848
let root_manager = RootManager::new(storage.clone(), Box::new(NopCache));
4949
root_manager.flush::<&str>(&root_writer).await?;
@@ -87,7 +87,8 @@ mod tests {
8787
let storage = Storage::Local(LocalStorage::new(temp_dir.path().to_str().unwrap()));
8888

8989
let block_ids = vec![Uuid::new_v4(), Uuid::new_v4(), Uuid::new_v4()];
90-
let result = create_test_sparse_index(&storage, block_ids.clone(), None).await;
90+
let result =
91+
create_test_sparse_index(&storage, Uuid::new_v4(), block_ids.clone(), None).await;
9192
assert!(result.is_ok());
9293

9394
// Verify the sparse index was created by trying to read it
@@ -107,7 +108,7 @@ mod tests {
107108
let temp_dir = TempDir::new().unwrap();
108109
let storage = Storage::Local(LocalStorage::new(temp_dir.path().to_str().unwrap()));
109110

110-
let result = create_test_sparse_index(&storage, vec![], None).await;
111+
let result = create_test_sparse_index(&storage, Uuid::new_v4(), vec![], None).await;
111112
assert!(matches!(
112113
result,
113114
Err(e) if e.to_string().contains("Cannot create sparse index with empty block IDs")
@@ -121,7 +122,7 @@ mod tests {
121122

122123
let block_ids = vec![Uuid::new_v4(), Uuid::new_v4()];
123124
let prefix = Some("custom".to_string());
124-
let result = create_test_sparse_index(&storage, block_ids, prefix).await;
125+
let result = create_test_sparse_index(&storage, Uuid::new_v4(), block_ids, prefix).await;
125126
assert!(result.is_ok());
126127
}
127128
}

rust/garbage_collector/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,4 @@ tokio-test = "0.4"
5656
rand = { workspace = true }
5757
itertools = { workspace = true }
5858
tracing-test = { version = "0.2.5" }
59+
tracing-subscriber = { workspace = true }

0 commit comments

Comments
 (0)