Project

General

Profile

Actions

Bug #56993

open

rgw_object_lock.cc:The maximum time of bucket object lock is 24855 days

Added by yuxuan yang over 1 year ago. Updated 9 months ago.

Status:
Pending Backport
Priority:
Normal
Assignee:
Target version:
-
% Done:

0%

Source:
Tags:
object-lock low-hanging-fruit backport_processed
Backport:
pacific quincy reef
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
rgw
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

ceph::real_time RGWObjectLock::get_lock_until_date(const ceph::real_time& mtime) const {
if (!rule_exist) {
return ceph::real_time();
}
//if days = 24855,days*60*60*24 will overflow
int days = get_days();
if (days <= 0) {
days = get_years()*365;
}
return mtime + make_timespan(days*24*60*60);
}
Maybe we can replace int with int64_t or uint64_t?
ceph::real_time RGWObjectLock::get_lock_until_date(const ceph::real_time& mtime) const {
if (!rule_exist) {
return ceph::real_time();
}
int64_t days = get_days();
if (days <= 0) {
days = get_years()*365;
}
return mtime + make_timespan(days*24*60*60);
}
like this?


Files

GNDUMG`(]7HPWX3A[2PAS18.png (144 KB) GNDUMG`(]7HPWX3A[2PAS18.png yuxuan yang, 08/05/2022 02:55 AM

Related issues 4 (2 open2 closed)

Related to rgw - Bug #63537: object lock: The query does not match after the worm protection time is set to 2124, 1, 1Pending BackportCasey Bodley

Actions
Copied to rgw - Backport #62137: reef: rgw_object_lock.cc:The maximum time of bucket object lock is 24855 daysResolvedCasey BodleyActions
Copied to rgw - Backport #62138: pacific: rgw_object_lock.cc:The maximum time of bucket object lock is 24855 daysResolvedCasey BodleyActions
Copied to rgw - Backport #62139: quincy: rgw_object_lock.cc:The maximum time of bucket object lock is 24855 daysIn ProgressCasey BodleyActions
Actions #1

Updated by Casey Bodley over 1 year ago

  • Tags set to object-lock low-hanging-fruit

thanks, would you be willing to prepare and test a fix?

Actions #2

Updated by yuxuan yang over 1 year ago

Casey Bodley wrote:

thanks, would you be willing to prepare and test a fix?

yes,I do a test on it.The overflow was resolved.And I found a new thing, when the retention date of an object exceeds Feb 7, 2106, the retention date is calculated from Jan 1, 1970.Is it a bug?

Actions #3

Updated by Casey Bodley over 1 year ago

  • Assignee set to Matt Benjamin
Actions #4

Updated by Casey Bodley 11 months ago

  • Status changed from New to Fix Under Review
  • Assignee changed from Matt Benjamin to Casey Bodley
  • Backport set to pacific quincy reef
  • Pull request ID set to 52056
Actions #5

Updated by Casey Bodley 9 months ago

  • Subject changed from pacific:rgw_object_lock.cc:The maximum time of bucket object lock is 24855 days to rgw_object_lock.cc:The maximum time of bucket object lock is 24855 days
  • Status changed from Fix Under Review to Pending Backport
Actions #6

Updated by Backport Bot 9 months ago

  • Copied to Backport #62137: reef: rgw_object_lock.cc:The maximum time of bucket object lock is 24855 days added
Actions #7

Updated by Backport Bot 9 months ago

  • Copied to Backport #62138: pacific: rgw_object_lock.cc:The maximum time of bucket object lock is 24855 days added
Actions #8

Updated by Backport Bot 9 months ago

  • Copied to Backport #62139: quincy: rgw_object_lock.cc:The maximum time of bucket object lock is 24855 days added
Actions #9

Updated by Backport Bot 9 months ago

  • Tags changed from object-lock low-hanging-fruit to object-lock low-hanging-fruit backport_processed
Actions #10

Updated by Casey Bodley 5 months ago

  • Related to Bug #63537: object lock: The query does not match after the worm protection time is set to 2124, 1, 1 added
Actions

Also available in: Atom PDF