Skip to content

Commit 6f3e901

Browse files
authored
Merge pull request ceph#61533 from clwluvw/prepare-op-cleanup
rgw: remove unused log op info from prepare_op Reviewed-by: Casey Bodley <[email protected]>
2 parents 9f88fe0 + 1b59a15 commit 6f3e901

File tree

8 files changed

+22
-48
lines changed

8 files changed

+22
-48
lines changed

src/cls/rgw/cls_rgw_client.cc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,17 +296,13 @@ void cls_rgw_bucket_update_stats(librados::ObjectWriteOperation& o,
296296
}
297297

298298
void cls_rgw_bucket_prepare_op(ObjectWriteOperation& o, RGWModifyOp op, const string& tag,
299-
const cls_rgw_obj_key& key, const string& locator, bool log_op,
300-
uint16_t bilog_flags, const rgw_zone_set& zones_trace)
299+
const cls_rgw_obj_key& key, const string& locator)
301300
{
302301
rgw_cls_obj_prepare_op call;
303302
call.op = op;
304303
call.tag = tag;
305304
call.key = key;
306305
call.locator = locator;
307-
call.log_op = log_op;
308-
call.bilog_flags = bilog_flags;
309-
call.zones_trace = zones_trace;
310306
bufferlist in;
311307
encode(call, in);
312308
o.exec(RGW_CLASS, RGW_BUCKET_PREPARE_OP, in);

src/cls/rgw/cls_rgw_client.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,7 @@ void cls_rgw_bucket_update_stats(librados::ObjectWriteOperation& o,
365365
const std::map<RGWObjCategory, rgw_bucket_category_stats>* dec_stats = nullptr);
366366

367367
void cls_rgw_bucket_prepare_op(librados::ObjectWriteOperation& o, RGWModifyOp op, const std::string& tag,
368-
const cls_rgw_obj_key& key, const std::string& locator, bool log_op,
369-
uint16_t bilog_op, const rgw_zone_set& zones_trace);
368+
const cls_rgw_obj_key& key, const std::string& locator);
370369

371370
void cls_rgw_bucket_complete_op(librados::ObjectWriteOperation& o, RGWModifyOp op, const std::string& tag,
372371
const rgw_bucket_entry_ver& ver,

src/cls/rgw/cls_rgw_ops.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,6 @@ void rgw_cls_obj_prepare_op::dump(Formatter *f) const
125125
f->dump_string("name", key.name);
126126
f->dump_string("tag", tag);
127127
f->dump_string("locator", locator);
128-
f->dump_bool("log_op", log_op);
129-
f->dump_int("bilog_flags", bilog_flags);
130-
encode_json("zones_trace", zones_trace, f);
131128
}
132129

133130
void rgw_cls_obj_complete_op::generate_test_instances(list<rgw_cls_obj_complete_op*>& o)

src/cls/rgw/cls_rgw_ops.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ struct rgw_cls_obj_prepare_op
3232
cls_rgw_obj_key key;
3333
std::string tag;
3434
std::string locator;
35-
bool log_op;
36-
uint16_t bilog_flags;
37-
rgw_zone_set zones_trace;
35+
bool log_op{false}; // i'm useless, but i'm here for compatibility
36+
uint16_t bilog_flags{0}; // i'm useless, but i'm here for compatibility
37+
rgw_zone_set zones_trace; // i'm useless, but i'm here for compatibility
3838

39-
rgw_cls_obj_prepare_op() : op(CLS_RGW_OP_UNKNOWN), log_op(false), bilog_flags(0) {}
39+
rgw_cls_obj_prepare_op() : op(CLS_RGW_OP_UNKNOWN) {}
4040

4141
void encode(ceph::buffer::list &bl) const {
4242
ENCODE_START(7, 5, bl);

src/rgw/driver/rados/rgw_rados.cc

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3316,7 +3316,7 @@ int RGWRados::Object::Write::_do_write_meta(uint64_t size, uint64_t accounted_si
33163316

33173317
if (!index_op->is_prepared()) {
33183318
tracepoint(rgw_rados, prepare_enter, req_id.c_str());
3319-
r = index_op->prepare(rctx.dpp, CLS_RGW_OP_ADD, &state->write_tag, rctx.y, log_op);
3319+
r = index_op->prepare(rctx.dpp, CLS_RGW_OP_ADD, &state->write_tag, rctx.y);
33203320
tracepoint(rgw_rados, prepare_exit, req_id.c_str());
33213321
if (r < 0)
33223322
return r;
@@ -6162,7 +6162,7 @@ int RGWRados::Object::Delete::delete_obj(optional_yield y, const DoutPrefixProvi
61626162
}
61636163

61646164

6165-
r = index_op.prepare(dpp, CLS_RGW_OP_DEL, &state->write_tag, y, log_op);
6165+
r = index_op.prepare(dpp, CLS_RGW_OP_DEL, &state->write_tag, y);
61666166
if (r < 0)
61676167
return r;
61686168

@@ -6891,7 +6891,7 @@ int RGWRados::set_attrs(const DoutPrefixProvider *dpp, RGWObjectCtx* octx, RGWBu
68916891
string tag;
68926892
append_rand_alpha(cct, tag, tag, 32);
68936893
state->write_tag = tag;
6894-
r = index_op.prepare(dpp, CLS_RGW_OP_ADD, &state->write_tag, y, log_op);
6894+
r = index_op.prepare(dpp, CLS_RGW_OP_ADD, &state->write_tag, y);
68956895

68966896
if (r < 0)
68976897
return r;
@@ -7338,7 +7338,7 @@ int RGWRados::Bucket::UpdateIndex::guard_reshard(const DoutPrefixProvider *dpp,
73387338
}
73397339

73407340
int RGWRados::Bucket::UpdateIndex::prepare(const DoutPrefixProvider *dpp, RGWModifyOp op, const string *write_tag,
7341-
optional_yield y, bool log_op)
7341+
optional_yield y)
73427342
{
73437343
if (blind) {
73447344
return 0;
@@ -7353,10 +7353,8 @@ int RGWRados::Bucket::UpdateIndex::prepare(const DoutPrefixProvider *dpp, RGWMod
73537353
}
73547354
}
73557355

7356-
bool add_log = log_op && store->svc.zone->need_to_log_data();
7357-
73587356
int r = guard_reshard(dpp, obj, nullptr, [&](BucketShard *bs) -> int {
7359-
return store->cls_obj_prepare_op(dpp, *bs, op, optag, obj, bilog_flags, y, zones_trace, add_log);
7357+
return store->cls_obj_prepare_op(dpp, *bs, op, optag, obj, y);
73607358
}, y);
73617359
if (r < 0) {
73627360
return r;
@@ -9751,25 +9749,18 @@ bool RGWRados::process_expired_objects(const DoutPrefixProvider *dpp, optional_y
97519749
}
97529750

97539751
int RGWRados::cls_obj_prepare_op(const DoutPrefixProvider *dpp, BucketShard& bs, RGWModifyOp op, string& tag,
9754-
rgw_obj& obj, uint16_t bilog_flags, optional_yield y, rgw_zone_set *_zones_trace,
9755-
bool log_op)
9752+
rgw_obj& obj, optional_yield y)
97569753
{
97579754
const bool bitx = cct->_conf->rgw_bucket_index_transaction_instrumentation;
97589755
ldout_bitx(bitx, dpp, 10) << "ENTERING " << __func__ << ": bucket-shard=" << bs << " obj=" << obj << " tag=" << tag << " op=" << op << dendl_bitx;
97599756
ldout_bitx(bitx, dpp, 25) << "BACKTRACE: " << __func__ << ": " << ClibBackTrace(0) << dendl_bitx;
97609757

9761-
rgw_zone_set zones_trace;
9762-
if (_zones_trace) {
9763-
zones_trace = *_zones_trace;
9764-
}
9765-
zones_trace.insert(svc.zone->get_zone().id, bs.bucket.get_key());
9766-
97679758
ObjectWriteOperation o;
97689759
o.assert_exists(); // bucket index shard must exist
97699760

97709761
cls_rgw_obj_key key(obj.key.get_index_key_name(), obj.key.instance);
97719762
cls_rgw_guard_bucket_resharding(o, -ERR_BUSY_RESHARDING);
9772-
cls_rgw_bucket_prepare_op(o, op, tag, key, obj.key.get_loc(), log_op, bilog_flags, zones_trace);
9763+
cls_rgw_bucket_prepare_op(o, op, tag, key, obj.key.get_loc());
97739764
int ret = bs.bucket_obj.operate(dpp, std::move(o), y);
97749765
ldout_bitx(bitx, dpp, 10) << "EXITING " << __func__ << ": ret=" << ret << dendl_bitx;
97759766
return ret;

src/rgw/driver/rados/rgw_rados.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ class RGWRados
982982
zones_trace = _zones_trace;
983983
}
984984

985-
int prepare(const DoutPrefixProvider *dpp, RGWModifyOp, const std::string *write_tag, optional_yield y, bool log_op = true);
985+
int prepare(const DoutPrefixProvider *dpp, RGWModifyOp, const std::string *write_tag, optional_yield y);
986986
int complete(const DoutPrefixProvider *dpp, int64_t poolid, uint64_t epoch, uint64_t size,
987987
uint64_t accounted_size, const ceph::real_time& ut,
988988
const std::string& etag, const std::string& content_type,
@@ -1487,7 +1487,7 @@ int restore_obj_from_cloud(RGWLCCloudTierCtx& tier_ctx,
14871487
const DoutPrefixProvider *dpp, optional_yield y);
14881488

14891489
int cls_obj_prepare_op(const DoutPrefixProvider *dpp, BucketShard& bs, RGWModifyOp op, std::string& tag, rgw_obj& obj,
1490-
uint16_t bilog_flags, optional_yield y, rgw_zone_set *zones_trace = nullptr, bool log_op = true);
1490+
optional_yield y);
14911491
int cls_obj_complete_op(BucketShard& bs, const rgw_obj& obj, RGWModifyOp op, std::string& tag, int64_t pool, uint64_t epoch,
14921492
rgw_bucket_dir_entry& ent, RGWObjCategory category, std::list<rgw_obj_index_key> *remove_objs,
14931493
uint16_t bilog_flags, rgw_zone_set *zones_trace = nullptr, bool log_op = true);

src/test/cls_rgw/test_cls_rgw.cc

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,10 @@ void test_stats(librados::IoCtx& ioctx, const string& oid, RGWObjCategory catego
7171
}
7272

7373
void index_prepare(librados::IoCtx& ioctx, const string& oid, RGWModifyOp index_op,
74-
const string& tag, const cls_rgw_obj_key& key, const string& loc,
75-
uint16_t bi_flags = 0, bool log_op = true)
74+
const string& tag, const cls_rgw_obj_key& key, const string& loc)
7675
{
7776
ObjectWriteOperation op;
78-
rgw_zone_set zones_trace;
79-
cls_rgw_bucket_prepare_op(op, index_op, tag, key, loc, log_op, bi_flags, zones_trace);
77+
cls_rgw_bucket_prepare_op(op, index_op, tag, key, loc);
8078
ASSERT_EQ(0, ioctx.operate(oid, &op));
8179
}
8280

@@ -465,8 +463,7 @@ TEST_F(cls_rgw, index_list)
465463
string tag = str_int("tag", i);
466464
string loc = str_int("loc", i);
467465

468-
index_prepare(ioctx, bucket_oid, CLS_RGW_OP_ADD, tag, obj, loc,
469-
0 /* bi_flags */, false /* log_op */);
466+
index_prepare(ioctx, bucket_oid, CLS_RGW_OP_ADD, tag, obj, loc);
470467

471468
rgw_bucket_dir_entry_meta meta;
472469
meta.category = RGWObjCategory::None;
@@ -543,8 +540,7 @@ TEST_F(cls_rgw, index_list_delimited)
543540
string loc = str_int("loc", i);
544541
const string obj = str_int(p, i);
545542

546-
index_prepare(ioctx, bucket_oid, CLS_RGW_OP_ADD, tag, obj, loc,
547-
0 /* bi_flags */, false /* log_op */);
543+
index_prepare(ioctx, bucket_oid, CLS_RGW_OP_ADD, tag, obj, loc);
548544

549545
index_complete(ioctx, bucket_oid, CLS_RGW_OP_ADD, tag, epoch, obj, meta,
550546
0 /* bi_flags */, false /* log_op */);
@@ -558,8 +554,7 @@ TEST_F(cls_rgw, index_list_delimited)
558554
string loc = str_int("loc", i);
559555
const string obj = p + str_int("f", i);
560556

561-
index_prepare(ioctx, bucket_oid, CLS_RGW_OP_ADD, tag, obj, loc,
562-
0 /* bi_flags */, false /* log_op */);
557+
index_prepare(ioctx, bucket_oid, CLS_RGW_OP_ADD, tag, obj, loc);
563558

564559
index_complete(ioctx, bucket_oid, CLS_RGW_OP_ADD, tag, epoch, obj, meta,
565560
0 /* bi_flags */, false /* log_op */);
@@ -649,8 +644,7 @@ TEST_F(cls_rgw, bi_list)
649644
string obj = str_int(i % 4 ? "obj" : "об'єкт", i);
650645
string tag = str_int("tag", i);
651646
string loc = str_int("loc", i);
652-
index_prepare(ioctx, bucket_oid, CLS_RGW_OP_ADD, tag, obj, loc,
653-
RGW_BILOG_FLAG_VERSIONED_OP);
647+
index_prepare(ioctx, bucket_oid, CLS_RGW_OP_ADD, tag, obj, loc);
654648

655649
rgw_bucket_dir_entry_meta meta;
656650
meta.category = RGWObjCategory::None;

src/test/cls_rgw/test_cls_rgw_stats.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,7 @@ int index_prepare(librados::IoCtx& ioctx, const std::string& oid,
8888
{
8989
librados::ObjectWriteOperation op;
9090
const std::string loc; // empty
91-
constexpr bool log_op = false;
92-
constexpr int flags = 0;
93-
rgw_zone_set zones;
94-
cls_rgw_bucket_prepare_op(op, type, tag, key, loc, log_op, flags, zones);
91+
cls_rgw_bucket_prepare_op(op, type, tag, key, loc);
9592
return ioctx.operate(oid, &op);
9693
}
9794

0 commit comments

Comments
 (0)