]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: check for bucket resharding when adding an object
authorOrit Wasserman <owasserm@redhat.com>
Thu, 18 May 2017 19:48:28 +0000 (22:48 +0300)
committerYehuda Sadeh <yehuda@redhat.com>
Mon, 5 Jun 2017 20:17:51 +0000 (13:17 -0700)
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
src/rgw/rgw_op.cc

index d4a9326c3dd02a0ae020e062498acfb528cd23bf..cc9f290ecad9baa6ece020c464eb5eee886ff033 100644 (file)
@@ -3118,6 +3118,16 @@ void RGWPutObj::execute()
       ldout(s->cct, 20) << "check_quota() returned ret=" << op_ret << dendl;
       goto done;
     }
+    bool need_resharding = false;
+    op_ret = store->check_bucket_shards(s->bucket_owner.get_id(), s->bucket,
+                                       bucket_quota, s->bucket_info.num_shards, need_resharding);
+    if (op_ret < 0) {
+      ldout(s->cct, 20) << "check_bucket_shards() returned ret=" << op_ret << dendl;
+      goto done;
+    } else if (need_resharding) {
+      /* Add to resharding queue */
+      ldout(s->cct, 20) << s->bucket << " needs resharding " << dendl;
+    }
   }
 
   if (supplied_etag) {