]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: when you abort a multipart upload request, the quota will not update 29703/head
authorRichard Bai(白学余) <baixueyu@inspur.com>
Tue, 13 Aug 2019 12:56:55 +0000 (20:56 +0800)
committerRichard Bai(白学余) <baixueyu@inspur.com>
Tue, 3 Sep 2019 09:32:11 +0000 (17:32 +0800)
Fixes: https://tracker.ceph.com/issues/41606
Signed-off-by: Richard Bai(白学余) <baixueyu@inspur.com>
src/rgw/rgw_multi.cc
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h

index f06818155e966fa75155e97b1a0a5dd7edc20e15..8bdff30fbb76bda45bcc7f3f154fbf04ce23ad1d 100644 (file)
@@ -212,6 +212,7 @@ int abort_multipart_upload(RGWRados *store, CephContext *cct,
   bool truncated;
   int marker = 0;
   int ret;
+  uint64_t parts_accounted_size = 0;
 
   do {
     ret = list_multipart_parts(store, bucket_info, cct,
@@ -248,6 +249,7 @@ int abort_multipart_upload(RGWRados *store, CephContext *cct,
           remove_objs.push_back(key);
         }
       }
+      parts_accounted_size += obj_part.accounted_size;
     }
   } while (truncated);
 
@@ -265,6 +267,9 @@ int abort_multipart_upload(RGWRados *store, CephContext *cct,
   if (!remove_objs.empty()) {
     del_op.params.remove_objs = &remove_objs;
   }
+  
+  del_op.params.abortmp = true;
+  del_op.params.parts_accounted_size = parts_accounted_size;
 
   // and also remove the metadata obj
   ret = del_op.delete_obj(null_yield);
index 12e74eb7c582545e3816dff76b2b07b06f52739f..bac3fac32c30cb8286bbdd962f7046751f1b7108 100644 (file)
@@ -4771,6 +4771,10 @@ int RGWRados::Object::Delete::delete_obj(optional_yield y)
   }
   uint64_t obj_accounted_size = state->accounted_size;
 
+  if(params.abortmp) {
+    obj_accounted_size = params.parts_accounted_size;
+  }
+
   if (!real_clock::is_zero(params.expiration_time)) {
     bufferlist bl;
     real_time delete_at;
index d5963429dc435787c717c8c3200398a1e2088406..a4434931c0a0525a2084db521dea297133a52b1a 100644 (file)
@@ -814,8 +814,10 @@ public:
         ceph::real_time mtime; /* for setting delete marker mtime */
         bool high_precision_time;
         rgw_zone_set *zones_trace;
+       bool abortmp;
+       uint64_t parts_accounted_size;
 
-        DeleteParams() : versioning_status(0), olh_epoch(0), bilog_flags(0), remove_objs(NULL), high_precision_time(false), zones_trace(nullptr) {}
+        DeleteParams() : versioning_status(0), olh_epoch(0), bilog_flags(0), remove_objs(NULL), high_precision_time(false), zones_trace(nullptr), abortmp(false), parts_accounted_size(0) {}
       } params;
 
       struct DeleteResult {