@@ -305,7 +305,12 @@ int commit_logging_object(const configuration& conf,
305305 target_bucket->get_key () << " '. ret = " << ret << dendl;
306306 return ret;
307307 }
308- return target_bucket->commit_logging_object (obj_name, y, dpp);
308+ if (const auto ret = target_bucket->commit_logging_object (obj_name, y, dpp); ret <0 ) {
309+ ldpp_dout (dpp, 1 ) << " ERROR: failed to commit logging object '" << obj_name << " ' of bucket '" <<
310+ target_bucket->get_key () << " '. ret = " << ret << dendl;
311+ return ret;
312+ }
313+ return 0 ;
309314}
310315
311316int rollover_logging_object (const configuration& conf,
@@ -548,6 +553,32 @@ int log_record(rgw::sal::Driver* driver,
548553 return -EINVAL;
549554 }
550555
556+ // get quota of the owner of the target bucket
557+ RGWQuota user_quota;
558+ if (ret = get_owner_quota_info (dpp, y, driver, target_bucket->get_owner (), user_quota); ret < 0 ) {
559+ ldpp_dout (dpp, 1 ) << " ERROR: failed to get quota of owner of target logging bucket '" <<
560+ target_bucket_id << " ' failed. ret = " << ret << dendl;
561+ return ret;
562+ }
563+ // start with system default quota
564+ // and combine with the user quota
565+ RGWQuota quota;
566+ driver->get_quota (quota);
567+ if (target_bucket->get_info ().quota .enabled ) {
568+ quota.bucket_quota = target_bucket->get_info ().quota ;
569+ } else if (user_quota.bucket_quota .enabled ) {
570+ quota.bucket_quota = user_quota.bucket_quota ;
571+ }
572+ if (user_quota.user_quota .enabled ) {
573+ quota.user_quota = user_quota.user_quota ;
574+ }
575+ // verify there is enough quota to write the record
576+ if (ret = target_bucket->check_quota (dpp, quota, record.length (), y); ret < 0 ) {
577+ ldpp_dout (dpp, 1 ) << " ERROR: quota check on target logging bucket '" <<
578+ target_bucket_id << " ' failed. ret = " << ret << dendl;
579+ return ret;
580+ }
581+
551582 if (ret = target_bucket->write_logging_object (obj_name,
552583 record,
553584 y,
0 commit comments