[ 
https://issues.apache.org/jira/browse/HDDS-17913?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Attila Doroszlai updated HDDS-17913:
------------------------------------
    Priority: Critical  (was: Major)

> Lifecycle Expiration Date rule checks key modification time instead of 
> current time
> -----------------------------------------------------------------------------------
>
>                 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
>            Priority: Critical
>              Labels: pull-request-available
>             Fix For: 2.3.0
>
>
> {{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]

Reply via email to