Skip to content

Commit 23bbd1e

Browse files
authored
Merge pull request ceph#55252 from jzhu116-bloomberg/wip-21800
rgw/multisite: avoid writing multipart parts to the bucket index log Reviewed-by: Casey Bodley <[email protected]>
2 parents 60da519 + 6383093 commit 23bbd1e

File tree

3 files changed

+10
-17
lines changed

3 files changed

+10
-17
lines changed

src/cls/rgw/cls_rgw.cc

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ static int read_key_entry(cls_method_context_t hctx, const cls_rgw_obj_key& key,
963963
// called by rgw_bucket_complete_op() for each item in op.remove_objs
964964
static int complete_remove_obj(cls_method_context_t hctx,
965965
rgw_bucket_dir_header& header,
966-
const cls_rgw_obj_key& key, bool log_op)
966+
const cls_rgw_obj_key& key)
967967
{
968968
rgw_bucket_dir_entry entry;
969969
string idx;
@@ -978,17 +978,6 @@ static int complete_remove_obj(cls_method_context_t hctx,
978978
int(entry.meta.category));
979979
unaccount_entry(header, entry);
980980

981-
if (log_op) {
982-
++header.ver; // increment index version, or we'll overwrite keys previously written
983-
const std::string tag;
984-
ret = log_index_operation(hctx, key, CLS_RGW_OP_DEL, tag, entry.meta.mtime,
985-
entry.ver, CLS_RGW_STATE_COMPLETE, header.ver,
986-
header.max_marker, 0, nullptr, nullptr, nullptr);
987-
if (ret < 0) {
988-
return ret;
989-
}
990-
}
991-
992981
ret = cls_cxx_map_remove_key(hctx, idx);
993982
if (ret < 0) {
994983
CLS_LOG(1, "%s: cls_cxx_map_remove_key failed with %d", __func__, ret);
@@ -1210,7 +1199,7 @@ int rgw_bucket_complete_op(cls_method_context_t hctx, bufferlist *in, bufferlist
12101199
CLS_LOG_BITX(bitx_inst, 20,
12111200
"INFO: %s: completing object remove key=%s",
12121201
__func__, escape_str(remove_key.to_string()).c_str());
1213-
rc = complete_remove_obj(hctx, header, remove_key, default_log_op);
1202+
rc = complete_remove_obj(hctx, header, remove_key);
12141203
if (rc < 0) {
12151204
CLS_LOG_BITX(bitx_inst, 1,
12161205
"WARNING: %s: complete_remove_obj, failed to remove entry, "

src/rgw/driver/rados/rgw_sal_rados.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2304,7 +2304,7 @@ int RadosMultipartUpload::init(const DoutPrefixProvider *dpp, optional_yield y,
23042304
encode(upload_info, bl);
23052305
obj_op.meta.data = &bl;
23062306

2307-
ret = obj_op.write_meta(bl.length(), 0, attrs, rctx);
2307+
ret = obj_op.write_meta(bl.length(), 0, attrs, rctx, false);
23082308
} while (ret == -EEXIST);
23092309

23102310
return ret;
@@ -2919,7 +2919,7 @@ int RadosMultipartWriter::complete(size_t accounted_size, const std::string& eta
29192919
uint32_t flags)
29202920
{
29212921
return processor.complete(accounted_size, etag, mtime, set_mtime, attrs, delete_at,
2922-
if_match, if_nomatch, user_data, zones_trace, canceled, rctx, flags);
2922+
if_match, if_nomatch, user_data, zones_trace, canceled, rctx, flags);
29232923
}
29242924

29252925
bool RadosZoneGroup::placement_target_exists(std::string& target) const

src/rgw/rgw_op.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4525,12 +4525,16 @@ void RGWPutObj::execute(optional_yield y)
45254525
emplace_attr(RGW_ATTR_OBJECT_RETENTION, std::move(obj_retention_bl));
45264526
}
45274527

4528+
// don't track the individual parts of multipart uploads. they replicate in
4529+
// full after CompleteMultipart
4530+
const uint32_t complete_flags = multipart ? 0 : rgw::sal::FLAG_LOG_OP;
4531+
45284532
tracepoint(rgw_op, processor_complete_enter, s->req_id.c_str());
45294533
const req_context rctx{this, s->yield, s->trace.get()};
45304534
op_ret = processor->complete(s->obj_size, etag, &mtime, real_time(), attrs,
45314535
(delete_at ? *delete_at : real_time()), if_match, if_nomatch,
45324536
(user_data.empty() ? nullptr : &user_data), nullptr, nullptr,
4533-
rctx, rgw::sal::FLAG_LOG_OP);
4537+
rctx, complete_flags);
45344538
tracepoint(rgw_op, processor_complete_exit, s->req_id.c_str());
45354539
if (op_ret < 0) {
45364540
return;
@@ -6798,7 +6802,7 @@ void RGWCompleteMultipart::complete()
67986802
// when the bucket is, as that would add an unneeded delete marker
67996803
// moved to complete to prevent segmentation fault in publish commit
68006804
if (meta_obj.get() != nullptr) {
6801-
int ret = meta_obj->delete_object(this, null_yield, rgw::sal::FLAG_PREVENT_VERSIONING | rgw::sal::FLAG_LOG_OP);
6805+
int ret = meta_obj->delete_object(this, null_yield, rgw::sal::FLAG_PREVENT_VERSIONING);
68026806
if (ret >= 0) {
68036807
/* serializer's exclusive lock is released */
68046808
serializer->clear_locked();

0 commit comments

Comments
 (0)