Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify shard manager #157

Merged
merged 7 commits into from
Jan 30, 2025
Merged

Conversation

hoytak
Copy link
Collaborator

@hoytak hoytak commented Jan 29, 2025

This PR simplifies parts of the shard manager and adds some tests; it currently doesn't contain any significant functional changes.

  1. Uses Arc.
  2. Now uses a builder model to create things, avoiding &mut self methods.
  3. fully removes complicated drop logic that is no longer needed.
  4. Adds clean and smudge unit tests that have similar coverage to the integration tests with clean and smudge utility program.

@hoytak hoytak requested a review from seanses January 29, 2025 19:05
@@ -110,8 +112,10 @@ impl XorbUpload for ParallelXorbUploader {
upload_tasks.spawn_on(
async move {
let ret = upload_and_register_xorb(item, shard_manager, cas, cas_prefix).await;
if let Some(updater) = upload_progress_updater {
updater.update(xorb_data_len as u64);
if ret.is_ok() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a minor typo that I found debugging...

target_shard_min_size: u64,
chunk_dedup_disabled: bool,
chunk_dedup_enabled: bool,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an easier name...

@@ -165,7 +169,8 @@ async fn upload_and_register_xorb(
(*hash, pos as u32)
})
.collect();
cas.put(&cas_prefix, &cas_hash, data, chunk_and_boundaries).await?;
// XXXXXX
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm this comment?

@@ -185,7 +190,8 @@ async fn upload_and_register_xorb(
.collect();
let cas_info = MDBCASInfo { metadata, chunks };

shard_manager.add_cas_block(cas_info).await?;
// XXXXXXX
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm this comment?

@hoytak hoytak merged commit b015f31 into main Jan 30, 2025
2 checks passed
@hoytak hoytak deleted the hoytak/250127-shard-file-manager-simplified branch January 30, 2025 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants