adoroszlai commented on code in PR #11184:
URL: https://github.com/apache/ozone/pull/11184#discussion_r4045736234


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SequenceIdGenerator.java:
##########
@@ -347,8 +348,7 @@ public static void upgradeToSequenceId(SCMMetadataStore 
scmMetadataStore)
     // operations can take effect exactly once in a SCM HA cluster.
     if (sequenceIdTable.get(SequenceIdType.localId) == null) {
       long millisSinceEpoch = TimeUnit.DAYS.toMillis(
-          LocalDate.of(LocalDate.now().getYear() + 1, 1, 1).toEpochDay());
-
+          LocalDate.of(LocalDate.now(ZoneOffset.UTC).getYear() + 1, 1, 
1).toEpochDay());
       long localId = millisSinceEpoch << Short.SIZE;
       Preconditions.checkArgument(localId > UniqueId.next());

Review Comment:
   Also, there is still a very tiny possibility of year change between getting 
"start of next year" and checking it against `UniqueId.next()`.  How about 
adding +1 day?



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