diff options
author | Alex <alex@adnab.me> | 2023-06-09 15:34:09 +0000 |
---|---|---|
committer | Alex <alex@adnab.me> | 2023-06-09 15:34:09 +0000 |
commit | 0a06fda0da35f4018c39bf6aec90e55bdf42d241 (patch) | |
tree | d2b758400f336b63e236c431a965d191954322a8 /src/model/helper/bucket.rs | |
parent | e7e164a280dfc1c4adf9d6da6f3b2a9674eca4bd (diff) | |
parent | 3d477906d4ff418de10973db7bd3e940f2e47b2d (diff) | |
download | garage-0a06fda0da35f4018c39bf6aec90e55bdf42d241.tar.gz garage-0a06fda0da35f4018c39bf6aec90e55bdf42d241.zip |
Merge pull request 'Fix #204 (full Multipart Uploads semantics)' (#553) from nlnet-task1 into next
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/553
Diffstat (limited to 'src/model/helper/bucket.rs')
-rw-r--r-- | src/model/helper/bucket.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/model/helper/bucket.rs b/src/model/helper/bucket.rs index 4a488d7f..576d03f3 100644 --- a/src/model/helper/bucket.rs +++ b/src/model/helper/bucket.rs @@ -478,7 +478,9 @@ impl<'a> BucketHelper<'a> { // ---- /// Deletes all incomplete multipart uploads that are older than a certain time. - /// Returns the number of uploads aborted + /// Returns the number of uploads aborted. + /// This will also include non-multipart uploads, which may be lingering + /// after a node crash pub async fn cleanup_incomplete_uploads( &self, bucket_id: &Uuid, @@ -496,7 +498,9 @@ impl<'a> BucketHelper<'a> { .get_range( bucket_id, start, - Some(ObjectFilter::IsUploading), + Some(ObjectFilter::IsUploading { + check_multipart: None, + }), 1000, EnumerationOrder::Forward, ) @@ -508,7 +512,7 @@ impl<'a> BucketHelper<'a> { let aborted_versions = object .versions() .iter() - .filter(|v| v.is_uploading() && v.timestamp < older_than) + .filter(|v| v.is_uploading(None) && v.timestamp < older_than) .map(|v| ObjectVersion { state: ObjectVersionState::Aborted, uuid: v.uuid, |