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

Feat: msp move bucket stop storing #374

Merged
merged 41 commits into from
Feb 27, 2025
Merged

Conversation

links234
Copy link
Contributor

This PR is built on top of #373.

This fixes issue 35.

@links234 links234 requested a review from ffarall February 20, 2025 00:26
Base automatically changed from fix/msp-move-bucket-event-flow to main February 24, 2025 11:35
Comment on lines 1451 to 1457
if old_msp_id == Some(own_msp_id) {
// We are the old MSP, emit event to clean up
self.emit(BucketMovedAway {
bucket_id,
old_msp_id: own_msp_id,
new_msp_id: new_msp_id,
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be emitted in finality?

Comment on lines 61 to 81
async fn delete_bucket(&mut self, bucket_id: &BucketId) -> anyhow::Result<()> {
self.storage_hub_handler
.file_storage
.write()
.await
.delete_files_with_prefix(
&bucket_id
.as_ref()
.try_into()
.map_err(|_| anyhow!("Invalid bucket id"))?,
)
.map_err(|e| anyhow!("Failed to delete files with prefix: {:?}", e))?;

self.storage_hub_handler
.forest_storage_handler
.remove_forest_storage(&bucket_id.as_ref().to_vec())
.await;

Ok(())
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Move this down

@ffarall ffarall merged commit bfc03d2 into main Feb 27, 2025
9 checks passed
@ffarall ffarall deleted the feat/msp-move-bucekt-stop-storing branch February 27, 2025 13:10
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.

3 participants