Chung-En Lee created HDDS-17913:
-----------------------------------
Summary: Lifecycle Expiration Date rule expires keys before the
date and never expires keys created after it
Key: HDDS-17913
URL: https://issues.apache.org/jira/browse/HDDS-17913
Project: Apache Ozone
Issue Type: Sub-task
Reporter: Chung-En Lee
Assignee: Chung-En Lee
{{OmLCExpiration#isExpired}} evaluates an Expiration {{Date}} rule by comparing
the key's modification time with the rule's {{Date}}:
{code:java}if (zonedDateTime != null) {
Instant instant = Instant.ofEpochMilli(timestamp);
ZonedDateTime objectTime = instant.atZone(ZoneOffset.UTC);
return objectTime.isBefore(zonedDateTime);
}
{code}
It never checks the current time, so a key modified before the {{Date}} expires
before the {{Date}} arrives, and a key modified after the {{Date}} never
expires. It should check whether the current time has passed the {{Date}}, as
it did before HDDS-12786:
{code:java}return now.isAfter(zonedDateTime);
{code}
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]