]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: RGWOp_BILog_Status reads full status unconditionally
authorCasey Bodley <cbodley@redhat.com>
Thu, 19 Aug 2021 20:21:55 +0000 (16:21 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 17 Sep 2021 18:45:08 +0000 (14:45 -0400)
the calls to rgw_read_bucket_inc_sync_status() depend on
sync_status.incremental_gen, which we need to read via
rgw_read_bucket_full_sync_status() regardless of whether
we're returning it to the client (version > 1)

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_rest_log.cc

index 58b6e81c6a1c56bcd18c1887896972aa6b5e1f3f..41013df4e42983d23dcc6942f9048b30ef0a1fd5 100644 (file)
@@ -996,17 +996,15 @@ void RGWOp_BILog_Status::execute(optional_yield y)
 
     ldpp_dout(this, 20) << "RGWOp_BILog_Status::execute(optional_yield y): getting sync status for pipe=" << pipe << dendl;
 
-    if (version > 1) {
-      op_ret = rgw_read_bucket_full_sync_status(
-       this,
-       static_cast<rgw::sal::RadosStore*>(store),
-       pipe,
-       &status.sync_status,
-       s->yield);
-      if (op_ret < 0) {
-       ldpp_dout(this, -1) << "ERROR: rgw_read_bucket_full_sync_status() on pipe=" << pipe << " returned ret=" << op_ret << dendl;
-       return;
-      }
+    op_ret = rgw_read_bucket_full_sync_status(
+      this,
+      static_cast<rgw::sal::RadosStore*>(store),
+      pipe,
+      &status.sync_status,
+      s->yield);
+    if (op_ret < 0) {
+      ldpp_dout(this, -1) << "ERROR: rgw_read_bucket_full_sync_status() on pipe=" << pipe << " returned ret=" << op_ret << dendl;
+      return;
     }
 
     op_ret = rgw_read_bucket_inc_sync_status(
@@ -1064,18 +1062,17 @@ void RGWOp_BILog_Status::execute(optional_yield y)
       pipe.dest.bucket = pinfo->bucket;
     }
 
-    if (version > 1) {
-      op_ret = rgw_read_bucket_full_sync_status(
-       this,
-       static_cast<rgw::sal::RadosStore*>(store),
-       pipe,
-       &status.sync_status,
-       s->yield);
-      if (op_ret < 0) {
-       ldpp_dout(this, -1) << "ERROR: rgw_read_bucket_full_sync_status() on pipe=" << pipe << " returned ret=" << op_ret << dendl;
-       return;
-      }
+    op_ret = rgw_read_bucket_full_sync_status(
+      this,
+      static_cast<rgw::sal::RadosStore*>(store),
+      pipe,
+      &status.sync_status,
+      s->yield);
+    if (op_ret < 0) {
+      ldpp_dout(this, -1) << "ERROR: rgw_read_bucket_full_sync_status() on pipe=" << pipe << " returned ret=" << op_ret << dendl;
+      return;
     }
+
     int r = rgw_read_bucket_inc_sync_status(this, static_cast<rgw::sal::RadosStore*>(store),
                                            pipe, *pinfo, &bucket->get_info(), status.sync_status.incremental_gen, &current_status);
     if (r < 0) {