gavinchou commented on code in PR #40160:
URL: https://github.com/apache/doris/pull/40160#discussion_r1737875448


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java:
##########
@@ -1679,10 +1679,15 @@ private void transferToMaster() {
      */
     void advanceNextId() {
         long currentId = idGenerator.getBatchEndId();
-        long currentNanos = System.nanoTime();
+        long currentMill = System.currentTimeMillis();
         long nextId = currentId + 1;
-        if (nextId < currentNanos) {
-            nextId = currentNanos;
+        // Reserve at most 8 billion for use in case of bugs or frequent 
reboots (21 billion reboots)
+        if ((1L << 63) - nextId < (1L << 33)) {

Review Comment:
   ```suggestion
           // Reserve ~1 trillion for use in case of bugs or frequent reboots 
(~2 billion reboots)
           if ((1L << 63) - nextId < (1L << 40)) {
   ```



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