From 920d8a6e51a37e8328c2554121c7fe255c0a50b8 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Thu, 19 Aug 2021 16:21:55 -0400 Subject: [PATCH] rgw: RGWOp_BILog_Status reads full status unconditionally 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 --- src/rgw/rgw_rest_log.cc | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/src/rgw/rgw_rest_log.cc b/src/rgw/rgw_rest_log.cc index 58b6e81c6a1c5..41013df4e4298 100644 --- a/src/rgw/rgw_rest_log.cc +++ b/src/rgw/rgw_rest_log.cc @@ -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(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(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(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(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(store), pipe, *pinfo, &bucket->get_info(), status.sync_status.incremental_gen, ¤t_status); if (r < 0) { -- 2.39.5