Skip to content

Commit ccb6635

Browse files
committed
rgw/logging: add size in MPU complete in standard mode
Fixes: https://tracker.ceph.com/issues/71288 Signed-off-by: Yuval Lifshitz <[email protected]>
1 parent eea19fa commit ccb6635

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

src/rgw/rgw_op.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7133,6 +7133,12 @@ void RGWCompleteMultipart::execute(optional_yield y)
71337133
return;
71347134
}
71357135

7136+
// size is logged in stadared mode
7137+
int ret = rgw::bucketlogging::log_record(driver, rgw::bucketlogging::LoggingType::Standard, s->object.get(), s, canonical_name(), "", ofs, this, y, true, false);
7138+
if (ret < 0) {
7139+
ldpp_dout(this, 5) << "WARNING: in Standard mode, complete MPU operation ignores bucket logging failure: " << ret << dendl;
7140+
}
7141+
71367142
remove_objs.clear();
71377143

71387144
// use cls_version_check() when deleting the meta object to detect part uploads that raced
@@ -7178,7 +7184,7 @@ void RGWCompleteMultipart::execute(optional_yield y)
71787184
etag = s->object->get_attrs()[RGW_ATTR_ETAG].to_str();
71797185

71807186
// send request to notification manager
7181-
int ret = res->publish_commit(this, ofs, upload_time, etag, s->object->get_instance());
7187+
ret = res->publish_commit(this, ofs, upload_time, etag, s->object->get_instance());
71827188
if (ret < 0) {
71837189
ldpp_dout(this, 1) << "ERROR: publishing notification failed, with error: " << ret << dendl;
71847190
// too late to rollback operation, hence op_ret is not set here

src/rgw/rgw_op.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1972,6 +1972,7 @@ class RGWCompleteMultipart : public RGWOp {
19721972
const char* name() const override { return "complete_multipart"; }
19731973
RGWOpType get_type() override { return RGW_OP_COMPLETE_MULTIPART; }
19741974
uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; }
1975+
bool always_do_bucket_logging() const override { return false; }
19751976
};
19761977

19771978
class RGWAbortMultipart : public RGWOp {

src/rgw/rgw_process.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -467,15 +467,15 @@ int process_request(const RGWProcessEnv& penv,
467467
}
468468

469469
if (op && op->always_do_bucket_logging()) {
470-
std::ignore = rgw::bucketlogging::log_record(driver,
470+
std::ignore = rgw::bucketlogging::log_record(driver,
471471
rgw::bucketlogging::LoggingType::Standard,
472472
s->object.get(),
473-
s,
474-
op->canonical_name(),
475-
"",
473+
s,
474+
op->canonical_name(),
475+
"",
476476
(s->src_object ? s->src_object->get_size() : (s->object ? s->object->get_size() : 0)),
477-
op,
478-
yield,
477+
op,
478+
yield,
479479
true,
480480
false);
481481
}

0 commit comments

Comments
 (0)