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

   ## What changes were proposed in this pull request?
   
   SCM can fail to start when it is first deployed near a year boundary (e.g. 
Dec 31). During the one-time migration to `SequenceIdGenerator`, SCM seeds an 
initial `localId` and requires it to be strictly greater than any ID the legacy 
`UniqueId` generator could have produced. 
   The seed was computed using 
`LocalDate.of(LocalDate.now(ZoneOffset.UTC).getYear() + 1, 1, 1).toEpochDay())` 
(JVM local timezone), while `UniqueId.next()` uses `System.currentTimeMillis()` 
(UTC). 
   Near year boundaries these can disagree — for example, Dec 31 evening in US 
timezones while UTC is already Jan 1 — causing 
`Preconditions.checkArgument(localId > UniqueId.next())` to fail and SCM 
startup to abort.
   
   This proposed change computes the initial `localId` from the UTC calendar 
year as well.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-14337
   
   ## How was this patch tested?
   
   Unit Test.
   


-- 
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