]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/dynamic-resharding: remove creation of new bucket instance
authorShilpa Jagannath <smanjara@redhat.com>
Thu, 21 May 2020 12:33:01 +0000 (18:03 +0530)
committerAdam C. Emerson <aemerson@redhat.com>
Mon, 13 Sep 2021 16:27:48 +0000 (12:27 -0400)
Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
src/cls/rgw/cls_rgw.cc
src/cls/rgw/cls_rgw_types.cc
src/cls/rgw/cls_rgw_types.h
src/rgw/rgw_admin.cc
src/rgw/rgw_common.cc
src/rgw/rgw_reshard.cc
src/rgw/rgw_reshard.h

index 222803e34142389eca7a06f11630c06a50880931..6ca1ffe7b764e80d0a627d192af32fdfe066745d 100644 (file)
@@ -4240,7 +4240,7 @@ static int rgw_set_bucket_resharding(cls_method_context_t hctx, bufferlist *in,
     return rc;
   }
 
-  header.new_instance.set_status(op.entry.new_bucket_instance_id, op.entry.num_shards, op.entry.reshard_status);
+  header.new_instance.set_status(op.entry.bucket_instance_id, op.entry.num_shards, op.entry.reshard_status);
 
   return write_bucket_header(hctx, &header);
 }
index 247d9c00bccdbe2d6382cb90cb8ed7010391f974..5926f72d767bbb6d0bee7affe73568bba0fc0462 100644 (file)
@@ -720,10 +720,8 @@ void cls_rgw_reshard_entry::dump(Formatter *f) const
   encode_json("tenant", tenant, f);
   encode_json("bucket_name", bucket_name, f);
   encode_json("bucket_id", bucket_id, f);
-  encode_json("new_instance_id", new_instance_id, f);
   encode_json("old_num_shards", old_num_shards, f);
   encode_json("new_num_shards", new_num_shards, f);
-
 }
 
 void cls_rgw_reshard_entry::generate_test_instances(list<cls_rgw_reshard_entry*>& ls)
@@ -734,7 +732,6 @@ void cls_rgw_reshard_entry::generate_test_instances(list<cls_rgw_reshard_entry*>
   ls.back()->tenant = "tenant";
   ls.back()->bucket_name = "bucket1""";
   ls.back()->bucket_id = "bucket_id";
-  ls.back()->new_instance_id = "new_instance_id";
   ls.back()->old_num_shards = 8;
   ls.back()->new_num_shards = 64;
 }
@@ -742,7 +739,7 @@ void cls_rgw_reshard_entry::generate_test_instances(list<cls_rgw_reshard_entry*>
 void cls_rgw_bucket_instance_entry::dump(Formatter *f) const
 {
   encode_json("reshard_status", to_string(reshard_status), f);
-  encode_json("new_bucket_instance_id", new_bucket_instance_id, f);
+  encode_json("bucket_instance_id", bucket_instance_id, f);
   encode_json("num_shards", num_shards, f);
 
 }
@@ -753,7 +750,7 @@ void cls_rgw_bucket_instance_entry::generate_test_instances(
   ls.push_back(new cls_rgw_bucket_instance_entry);
   ls.push_back(new cls_rgw_bucket_instance_entry);
   ls.back()->reshard_status = RESHARD_STATUS::IN_PROGRESS;
-  ls.back()->new_bucket_instance_id = "new_instance_id";
+  ls.back()->bucket_instance_id = "instance_id";
 }
   
 void cls_rgw_lc_obj_head::dump(Formatter *f) const 
index 7314ad8e21cd17b30f850a0aad0ee6c17e29d166..2c2c1caa66b0f0530449fb51976240060bf88018 100644 (file)
@@ -759,13 +759,13 @@ struct cls_rgw_bucket_instance_entry {
   using RESHARD_STATUS = cls_rgw_reshard_status;
   
   cls_rgw_reshard_status reshard_status{RESHARD_STATUS::NOT_RESHARDING};
-  std::string new_bucket_instance_id;
+  std::string bucket_instance_id;
   int32_t num_shards{-1};
 
   void encode(ceph::buffer::list& bl) const {
     ENCODE_START(1, 1, bl);
     encode((uint8_t)reshard_status, bl);
-    encode(new_bucket_instance_id, bl);
+    encode(bucket_instance_id, bl);
     encode(num_shards, bl);
     ENCODE_FINISH(bl);
   }
@@ -775,7 +775,7 @@ struct cls_rgw_bucket_instance_entry {
     uint8_t s;
     decode(s, bl);
     reshard_status = (cls_rgw_reshard_status)s;
-    decode(new_bucket_instance_id, bl);
+    decode(bucket_instance_id, bl);
     decode(num_shards, bl);
     DECODE_FINISH(bl);
   }
@@ -785,14 +785,13 @@ struct cls_rgw_bucket_instance_entry {
 
   void clear() {
     reshard_status = RESHARD_STATUS::NOT_RESHARDING;
-    new_bucket_instance_id.clear();
   }
 
-  void set_status(const std::string& new_instance_id,
+  void set_status(const std::string& instance_id,
                  int32_t new_num_shards,
                  cls_rgw_reshard_status s) {
     reshard_status = s;
-    new_bucket_instance_id = new_instance_id;
+    bucket_instance_id = instance_id;
     num_shards = new_num_shards;
   }
 
@@ -1264,31 +1263,32 @@ struct cls_rgw_reshard_entry
   std::string tenant;
   std::string bucket_name;
   std::string bucket_id;
-  std::string new_instance_id;
   uint32_t old_num_shards{0};
   uint32_t new_num_shards{0};
 
   cls_rgw_reshard_entry() {}
 
   void encode(ceph::buffer::list& bl) const {
-    ENCODE_START(1, 1, bl);
+    ENCODE_START(2, 1, bl);
     encode(time, bl);
     encode(tenant, bl);
     encode(bucket_name, bl);
     encode(bucket_id, bl);
-    encode(new_instance_id, bl);
     encode(old_num_shards, bl);
     encode(new_num_shards, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(ceph::buffer::list::const_iterator& bl) {
-    DECODE_START(1, bl);
+    DECODE_START(2, bl);
     decode(time, bl);
     decode(tenant, bl);
     decode(bucket_name, bl);
     decode(bucket_id, bl);
-    decode(new_instance_id, bl);
+    if (struct_v < 2) {
+      std::string new_instance_id;
+      decode(new_instance_id, bl);
+    }
     decode(old_num_shards, bl);
     decode(new_num_shards, bl);
     DECODE_FINISH(bl);
index 992b5f1f5ba53616159600feaab5b49db2768686..77b6305feebdd3581065656ad57e51ee5af46c62 100644 (file)
@@ -1118,8 +1118,8 @@ static void show_reshard_status(
   for (const auto& entry : status) {
     formatter->open_object_section("entry");
     formatter->dump_string("reshard_status", to_string(entry.reshard_status));
-    formatter->dump_string("new_bucket_instance_id",
-                          entry.new_bucket_instance_id);
+    formatter->dump_string("bucket_instance_id",
+                          entry.bucket_instance_id);
     formatter->dump_int("num_shards", entry.num_shards);
     formatter->close_section();
   }
index d846aeac99a1b697cf1c81365956d4b07cae6b19..9ecd99adf329322bdd0397dd06d626b1094bcf80 100644 (file)
@@ -2254,7 +2254,7 @@ void RGWBucketInfo::decode(bufferlist::const_iterator& bl) {
     decode(swift_versioning, bl);
     if (swift_versioning) {
       decode(swift_ver_location, bl);
-    }
+   }
   }
   if (struct_v >= 17) {
     decode(creation_time, bl);
index 78c96d14c3932183fc3c42b5a6d994786406b304..1c9bc453d6ab820dcb5c335546e3d0aae8720e29 100644 (file)
@@ -264,17 +264,12 @@ RGWBucketReshard::RGWBucketReshard(rgw::sal::RadosStore* _store,
 int RGWBucketReshard::set_resharding_status(const DoutPrefixProvider *dpp,
                                             rgw::sal::RadosStore* store,
                                            const RGWBucketInfo& bucket_info,
-                                           const string& new_instance_id,
+                                           const string& instance_id,
                                            int32_t num_shards,
-                                           cls_rgw_reshard_status status)
+                                            cls_rgw_reshard_status status)
 {
-  if (new_instance_id.empty()) {
-    ldpp_dout(dpp, 0) << __func__ << " missing new bucket instance id" << dendl;
-    return -EINVAL;
-  }
-
   cls_rgw_bucket_instance_entry instance_entry;
-  instance_entry.set_status(new_instance_id, num_shards, status);
+  instance_entry.set_status(instance_id, num_shards, status);
 
   int ret = store->getRados()->bucket_set_reshard(dpp, bucket_info, instance_entry);
   if (ret < 0) {
@@ -334,7 +329,7 @@ int RGWBucketReshard::clear_index_shard_reshard_status(const DoutPrefixProvider
 
 static int create_new_bucket_instance(rgw::sal::RadosStore* store,
                                      int new_num_shards,
-                                     const RGWBucketInfo& bucket_info,
+                                     RGWBucketInfo& bucket_info,
                                      map<string, bufferlist>& attrs,
                                      RGWBucketInfo& new_bucket_info,
                                       const DoutPrefixProvider *dpp)
@@ -343,8 +338,7 @@ static int create_new_bucket_instance(rgw::sal::RadosStore* store,
 
   store->getRados()->create_bucket_id(&new_bucket_info.bucket.bucket_id);
 
-  new_bucket_info.layout.current_index.layout.normal.num_shards = new_num_shards;
-  new_bucket_info.objv_tracker.clear();
+  bucket_info.layout.resharding = rgw::BucketReshardState::None;
 
   new_bucket_info.new_bucket_instance_id.clear();
   new_bucket_info.reshard_status = cls_rgw_reshard_status::NOT_RESHARDING;
@@ -394,8 +388,8 @@ class BucketInfoReshardUpdate
 
   bool in_progress{false};
 
-  int set_status(cls_rgw_reshard_status s, const DoutPrefixProvider *dpp) {
-    bucket_info.reshard_status = s;
+  int set_status(rgw::BucketReshardState s, const DoutPrefixProvider *dpp) {
+    bucket_info.layout.resharding = s;
     int ret = store->getRados()->put_bucket_instance_info(bucket_info, false, real_time(), &bucket_attrs, dpp);
     if (ret < 0) {
       ldpp_dout(dpp, 0) << "ERROR: failed to write bucket info, ret=" << ret << dendl;
@@ -408,15 +402,12 @@ public:
   BucketInfoReshardUpdate(const DoutPrefixProvider *_dpp,
                           rgw::sal::RadosStore* _store,
                          RGWBucketInfo& _bucket_info,
-                          map<string, bufferlist>& _bucket_attrs,
-                         const string& new_bucket_id) :
+                          map<string, bufferlist>& _bucket_attrs) :
     dpp(_dpp),
     store(_store),
     bucket_info(_bucket_info),
     bucket_attrs(_bucket_attrs)
-  {
-    bucket_info.new_bucket_instance_id = new_bucket_id;
-  }
+  {}
 
   ~BucketInfoReshardUpdate() {
     if (in_progress) {
@@ -430,12 +421,12 @@ public:
       bucket_info.new_bucket_instance_id.clear();
 
       // clears new_bucket_instance as well
-      set_status(cls_rgw_reshard_status::NOT_RESHARDING, dpp);
+      set_status(rgw::BucketReshardState::None, dpp);
     }
   }
 
   int start() {
-    int ret = set_status(cls_rgw_reshard_status::IN_PROGRESS, dpp);
+    int ret = set_status(rgw::BucketReshardState::InProgress, dpp);
     if (ret < 0) {
       return ret;
     }
@@ -444,7 +435,7 @@ public:
   }
 
   int complete() {
-    int ret = set_status(cls_rgw_reshard_status::DONE, dpp);
+    int ret = set_status(rgw::BucketReshardState::None, dpp);
     if (ret < 0) {
       return ret;
     }
@@ -542,7 +533,6 @@ int RGWBucketReshardLock::renew(const Clock::time_point& now) {
 
 
 int RGWBucketReshard::do_reshard(int num_shards,
-                                RGWBucketInfo& new_bucket_info,
                                 int max_entries,
                                 bool verbose,
                                 ostream *out,
@@ -550,13 +540,8 @@ int RGWBucketReshard::do_reshard(int num_shards,
                                  const DoutPrefixProvider *dpp)
 {
   if (out) {
-    const rgw_bucket& bucket = bucket_info.bucket;
-    (*out) << "tenant: " << bucket.tenant << std::endl;
-    (*out) << "bucket name: " << bucket.name << std::endl;
-    (*out) << "old bucket instance id: " << bucket.bucket_id <<
-      std::endl;
-    (*out) << "new bucket instance id: " << new_bucket_info.bucket.bucket_id <<
-      std::endl;
+    (*out) << "tenant: " << bucket_info.bucket.tenant << std::endl;
+    (*out) << "bucket name: " << bucket_info.bucket.name << std::endl;
   }
 
   /* update bucket info -- in progress*/
@@ -570,7 +555,7 @@ int RGWBucketReshard::do_reshard(int num_shards,
 
   // NB: destructor cleans up sharding state if reshard does not
   // complete successfully
-  BucketInfoReshardUpdate bucket_info_updater(dpp, store, bucket_info, bucket_attrs, new_bucket_info.bucket.bucket_id);
+  BucketInfoReshardUpdate bucket_info_updater(dpp, store, bucket_info, bucket_attrs);
 
   int ret = bucket_info_updater.start();
   if (ret < 0) {
@@ -578,9 +563,9 @@ int RGWBucketReshard::do_reshard(int num_shards,
     return ret;
   }
 
-  int num_target_shards = (new_bucket_info.layout.current_index.layout.normal.num_shards > 0 ? new_bucket_info.layout.current_index.layout.normal.num_shards : 1);
+  int num_target_shards = bucket_info.layout.target_index->layout.normal.num_shards;
 
-  BucketReshardManager target_shards_mgr(dpp, store, new_bucket_info, num_target_shards);
+  BucketReshardManager target_shards_mgr(dpp, store, bucket_info, num_target_shards);
 
   bool verbose_json_out = verbose && (formatter != nullptr) && (out != nullptr);
 
@@ -628,13 +613,13 @@ int RGWBucketReshard::do_reshard(int num_shards,
        rgw_bucket_category_stats stats;
        bool account = entry.get_info(&cls_key, &category, &stats);
        rgw_obj_key key(cls_key);
-       rgw_obj obj(new_bucket_info.bucket, key);
+       rgw_obj obj(bucket_info.bucket, key);
        RGWMPObj mp;
        if (key.ns == RGW_OBJ_NS_MULTIPART && mp.from_meta(key.name)) {
          // place the multipart .meta object on the same shard as its head object
          obj.index_hash_source = mp.get_key();
        }
-       int ret = store->getRados()->get_target_shard_id(new_bucket_info.layout.current_index.layout.normal, obj.get_hash_object(), &target_shard_id);
+       int ret = store->getRados()->get_target_shard_id(bucket_info.layout.target_index->layout.normal, obj.get_hash_object(), &target_shard_id);
        if (ret < 0) {
          ldpp_dout(dpp, -1) << "ERROR: get_target_shard_id() returned ret=" << ret << dendl;
          return ret;
@@ -687,16 +672,13 @@ int RGWBucketReshard::do_reshard(int num_shards,
     return -EIO;
   }
 
-  ret = store->ctl()->bucket->link_bucket(new_bucket_info.owner, new_bucket_info.bucket, bucket_info.creation_time, null_yield, dpp);
-  if (ret < 0) {
-    ldpp_dout(dpp, -1) << "failed to link new bucket instance (bucket_id=" << new_bucket_info.bucket.bucket_id << ": " << cpp_strerror(-ret) << ")" << dendl;
-    return ret;
-  }
-
-  ret = bucket_info_updater.complete();
+  //overwrite current_index for the next reshard process
+  bucket_info.layout.current_index = *bucket_info.layout.target_index;
+  bucket_info.layout.resharding = rgw::BucketReshardState::None;
+  ret = store->getRados()->put_bucket_instance_info(bucket_info, false, real_time(), &bucket_attrs, dpp);
   if (ret < 0) {
-    ldpp_dout(dpp, 0) << __func__ << ": failed to update bucket info ret=" << ret << dendl;
-    /* don't error out, reshard process succeeded */
+    ldpp_dout(dpp, -1) << "ERROR: failed writing bucket instance info: " << dendl;
+      return ret;
   }
 
   return 0;
@@ -722,27 +704,28 @@ int RGWBucketReshard::execute(int num_shards, int max_op_entries,
   RGWBucketInfo new_bucket_info;
   ret = create_new_bucket_instance(num_shards, new_bucket_info, dpp);
   if (ret < 0) {
-    // shard state is uncertain, but this will attempt to remove them anyway
+    return ret;
     goto error_out;
   }
 
   if (reshard_log) {
-    ret = reshard_log->update(dpp, bucket_info, new_bucket_info);
+    ret = reshard_log->update(dpp, bucket_info);
     if (ret < 0) {
+      return ret;
       goto error_out;
     }
   }
 
   // set resharding status of current bucket_info & shards with
   // information about planned resharding
-  ret = set_resharding_status(dpp, new_bucket_info.bucket.bucket_id,
+  ret = set_resharding_status(dpp, bucket_info.bucket.bucket_id,
                              num_shards, cls_rgw_reshard_status::IN_PROGRESS);
   if (ret < 0) {
+    return ret;
     goto error_out;
   }
 
   ret = do_reshard(num_shards,
-                  new_bucket_info,
                   max_op_entries,
                    verbose, out, formatter, dpp);
   if (ret < 0) {
@@ -754,30 +737,20 @@ int RGWBucketReshard::execute(int num_shards, int max_op_entries,
 
   reshard_lock.unlock();
 
-  // resharding successful, so remove old bucket index shards; use
-  // best effort and don't report out an error; the lock isn't needed
-  // at this point since all we're using a best effor to to remove old
-  // shard objects
-  ret = store->svc()->bi->clean_index(dpp, bucket_info);
-  if (ret < 0) {
-    ldpp_dout(dpp, -1) << "Error: " << __func__ <<
-      " failed to clean up old shards; " <<
-      "RGWRados::clean_bucket_index returned " << ret << dendl;
-  }
+   // resharding successful, so remove old bucket index shards; use
+   // best effort and don't report out an error; the lock isn't needed
+   // at this point since all we're using a best effor to to remove old
+   // shard objects
 
-  ret = store->ctl()->bucket->remove_bucket_instance_info(bucket_info.bucket,
-                                                       bucket_info, null_yield, dpp);
-  if (ret < 0) {
-    ldpp_dout(dpp, -1) << "Error: " << __func__ <<
-      " failed to clean old bucket info object \"" <<
-      bucket_info.bucket.get_key() <<
-      "\"created after successful resharding with error " << ret << dendl;
+   ret = store->svc()->bi->clean_index(dpp, bucket_info);
+   if (ret < 0) {
+     lderr(store->ctx()) << "Error: " << __func__ <<
+      " failed to clean up old shards; " <<
+     "RGWRados::clean_bucket_index returned " << ret << dendl;
   }
 
   ldpp_dout(dpp, 1) << __func__ <<
-    " INFO: reshard of bucket \"" << bucket_info.bucket.name << "\" from \"" <<
-    bucket_info.bucket.get_key() << "\" to \"" <<
-    new_bucket_info.bucket.get_key() << "\" completed successfully" << dendl;
+    " INFO: reshard of bucket \"" << bucket_info.bucket.name << "\" completed successfully" << dendl;
 
   return 0;
 
@@ -785,26 +758,18 @@ error_out:
 
   reshard_lock.unlock();
 
+
+  //TODO: Cleanup failed incomplete resharding
   // since the real problem is the issue that led to this error code
   // path, we won't touch ret and instead use another variable to
   // temporarily error codes
-  int ret2 = store->svc()->bi->clean_index(dpp, new_bucket_info);
+  int ret2 = store->svc()->bi->clean_index(dpp, bucket_info);
   if (ret2 < 0) {
     ldpp_dout(dpp, -1) << "Error: " << __func__ <<
       " failed to clean up shards from failed incomplete resharding; " <<
       "RGWRados::clean_bucket_index returned " << ret2 << dendl;
   }
 
-  ret2 = store->ctl()->bucket->remove_bucket_instance_info(new_bucket_info.bucket,
-                                                        new_bucket_info,
-                                                       null_yield, dpp);
-  if (ret2 < 0) {
-    ldpp_dout(dpp, -1) << "Error: " << __func__ <<
-      " failed to clean bucket info object \"" <<
-      new_bucket_info.bucket.get_key() <<
-      "\"created during incomplete resharding with error " << ret2 << dendl;
-  }
-
   return ret;
 } // execute
 
@@ -838,11 +803,6 @@ void RGWReshard::get_bucket_logshard_oid(const string& tenant, const string& buc
 
 int RGWReshard::add(const DoutPrefixProvider *dpp, cls_rgw_reshard_entry& entry)
 {
-  if (!store->svc()->zone->can_reshard()) {
-    ldpp_dout(dpp, 20) << __func__ << " Resharding is disabled"  << dendl;
-    return 0;
-  }
-
   string logshard_oid;
 
   get_bucket_logshard_oid(entry.tenant, entry.bucket_name, &logshard_oid);
@@ -858,7 +818,7 @@ int RGWReshard::add(const DoutPrefixProvider *dpp, cls_rgw_reshard_entry& entry)
   return 0;
 }
 
-int RGWReshard::update(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, const RGWBucketInfo& new_bucket_info)
+int RGWReshard::update(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info)
 {
   cls_rgw_reshard_entry entry;
   entry.bucket_name = bucket_info.bucket.name;
@@ -870,8 +830,6 @@ int RGWReshard::update(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucke
     return ret;
   }
 
-  entry.new_instance_id = new_bucket_info.bucket.name + ":"  + new_bucket_info.bucket.bucket_id;
-
   ret = add(dpp, entry);
   if (ret < 0) {
     ldpp_dout(dpp, 0) << __func__ << ":Error in updating entry bucket " << entry.bucket_name << ": " <<
@@ -1029,7 +987,6 @@ int RGWReshard::process_single_logshard(int logshard_num, const DoutPrefixProvid
     }
 
     for(auto& entry: entries) { // logshard entries
-      if(entry.new_instance_id.empty()) {
 
        ldpp_dout(dpp, 20) << __func__ << " resharding " <<
          entry.bucket_name  << dendl;
@@ -1076,6 +1033,7 @@ int RGWReshard::process_single_logshard(int logshard_num, const DoutPrefixProvid
          goto finished_entry;
        }
 
+       {
        RGWBucketReshard br(store, bucket_info, attrs, nullptr);
        ret = br.execute(entry.new_num_shards, max_entries, dpp, false, nullptr,
                         nullptr, this);
@@ -1096,8 +1054,8 @@ int RGWReshard::process_single_logshard(int logshard_num, const DoutPrefixProvid
            entry.bucket_name << " from resharding queue: " <<
            cpp_strerror(-ret) << dendl;
          return ret;
+         }
        }
-      } // if new instance id is empty
 
     finished_entry:
 
@@ -1129,10 +1087,6 @@ void  RGWReshard::get_logshard_oid(int shard_num, string *logshard)
 
 int RGWReshard::process_all_logshards(const DoutPrefixProvider *dpp)
 {
-  if (!store->svc()->zone->can_reshard()) {
-    ldpp_dout(dpp, 20) << __func__ << " Resharding is disabled"  << dendl;
-    return 0;
-  }
   int ret = 0;
 
   for (int i = 0; i < num_logshards; i++) {
index 0cfca38bfb7b421b3604d1523420e40cd66e1cb5..09600de81359958e38f0f80e7eeabf785d725ed4 100644 (file)
@@ -88,7 +88,6 @@ private:
                                 RGWBucketInfo& new_bucket_info,
                                  const DoutPrefixProvider *dpp);
   int do_reshard(int num_shards,
-                RGWBucketInfo& new_bucket_info,
                 int max_entries,
                  bool verbose,
                  std::ostream *os,
@@ -236,7 +235,7 @@ protected:
 public:
   RGWReshard(rgw::sal::RadosStore* _store, bool _verbose = false, std::ostream *_out = nullptr, Formatter *_formatter = nullptr);
   int add(const DoutPrefixProvider *dpp, cls_rgw_reshard_entry& entry);
-  int update(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, const RGWBucketInfo& new_bucket_info);
+  int update(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info);
   int get(const DoutPrefixProvider *dpp, cls_rgw_reshard_entry& entry);
   int remove(const DoutPrefixProvider *dpp, cls_rgw_reshard_entry& entry);
   int list(const DoutPrefixProvider *dpp, int logshard_num, std::string& marker, uint32_t max, std::list<cls_rgw_reshard_entry>& entries, bool *is_truncated);