Skip to content

Commit eea6525

Browse files
committed
rgw/logging: fixes data loss during rollover
Multiple threads attempting to roll over the same log object can result in the creation of numerous orphan tail objects, each with a single record. This occurs when a NULL RGWObjVersionTracker is used during the creation of a new logging object. These records are inaccessible, leading to data loss, which is particularly critical in Journal mode. Furthermore, valid log tail objects may be added to the Garbage Collection (GC) list, exacerbating data loss. Fixes: https://tracker.ceph.com/issues/72740 Signed-off-by: N Balachandran <[email protected]>
1 parent f965675 commit eea6525

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/rgw/rgw_bucket_logging.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ int log_record(rgw::sal::Driver* driver,
495495
}
496496
} else if (ret == -ENOENT) {
497497
// try to create the temporary log object for the first time
498-
ret = new_logging_object(conf, target_bucket, obj_name, dpp, region, s->bucket, y, std::nullopt, nullptr);
498+
ret = new_logging_object(conf, target_bucket, obj_name, dpp, region, s->bucket, y, std::nullopt, &objv_tracker);
499499
if (ret == 0) {
500500
ldpp_dout(dpp, 20) << "INFO: first time logging for bucket '" << target_bucket_id << "' and prefix '" <<
501501
conf.target_prefix << "'" << dendl;
@@ -633,7 +633,7 @@ int log_record(rgw::sal::Driver* driver,
633633
if (ret == -EFBIG) {
634634
ldpp_dout(dpp, 5) << "WARNING: logging object '" << obj_name << "' is full, will be committed to bucket '" <<
635635
target_bucket->get_key() << "'" << dendl;
636-
if (ret = rollover_logging_object(conf, target_bucket, obj_name, dpp, region, s->bucket, y, true, nullptr, nullptr); ret < 0 ) {
636+
if (ret = rollover_logging_object(conf, target_bucket, obj_name, dpp, region, s->bucket, y, true, &objv_tracker, nullptr); ret < 0 ) {
637637
return ret;
638638
}
639639
if (ret = target_bucket->write_logging_object(obj_name,

0 commit comments

Comments
 (0)