chungen0126 opened a new pull request, #12149:
URL: https://github.com/apache/ozone/pull/12149

   ## What changes were proposed in this pull request?
   
   `OmLCExpiration#isExpired` evaluates an Expiration `Date` rule by comparing 
the key's modification time with the `Date`. 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. This was introduced by HDDS-12786. 
Before that, the check was whether the current time had passed the `Date`, 
which matches S3: once the date has passed, all matching objects expire, 
including objects created after it.
   
   This PR restores `now.isAfter(zonedDateTime)` for `Date` rules.
   
   Several `TestKeyLifecycleService` tests relied on the old behavior. They set 
the `Date` in the future (2s, or 600s with `LONG_EXPIRE_SECONDS`) and expected 
keys to expire on the first scan.
     - Tests that run a single scan, wait at the injector before deletion, or 
check exact iterated key counts now use a `Date` that has already passed 
(`now`). `LONG_EXPIRE_SECONDS` is no longer used and is removed.
     - In `testMultipleDirectoriesMatched`, the cases that modify a directory 
after the `Date` now expect the directory to be deleted.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-17913
   
   ## How was this patch tested?
   
   - New unit test `TestOmLCExpiration#testIsExpiredWithDate` covers both 
cases. It fails without the fix.
   - `TestKeyLifecycleService` passes locally (396 tests, 0 failures). 
`testMoveToTrashWithTrashPrefix` now moves the keys to trash before checking 
that `.Trash` is skipped.
   - CI: (link to the fork CI run)
   
   Generated-by: Claude Code (Claude Opus 5.5)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to