gavinchou commented on code in PR #33817: URL: https://github.com/apache/doris/pull/33817#discussion_r1571074494
########## fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java: ########## @@ -1601,6 +1605,23 @@ private void transferToMaster() { } } + /* + * Advance the id generator, ensuring it doesn't roll back. + * + * If we need to support time travel, the next id cannot be rolled back to avoid + * errors in the corresponding relationship of the metadata recorded in BE/MS. + */ + void advanceNextId() { + long currentId = idGenerator.getBatchEndId(); + long currentNanos = System.nanoTime(); + long nextId = currentId + 1; + if (nextId < currentNanos) { + nextId = currentNanos; + } + idGenerator.setId(nextId); Review Comment: Do we need to persist the advanced id in case of wallclock rollback? And, maybe there are some other IdGenerators that need to be taken into consideration. <img width="416" alt="image" src="https://github.com/apache/doris/assets/6919662/074dd5f7-e8e4-475c-ac05-14d03d71e291"> -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org