yiguolei commented on code in PR #22047: URL: https://github.com/apache/doris/pull/22047#discussion_r1271380319
########## fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java: ########## @@ -5330,6 +5344,58 @@ private static void addTableComment(Table table, StringBuilder sb) { } } + public void writeVersionFile(String version, int seq) { + String versionName = versionDir + "/" + version + "-commitid-" + seq + "-version"; + File versionFile = new File(versionName); + try { + versionFile.createNewFile(); + } catch (Exception e) { + LOG.error(e.toString()); + } + } + + public boolean isMajorVersionUpgrade() { + if (previousFeVersion == null) { + // There are two possible scenarios when there is no 'previousFeVersion': + // If 'image' is empty, it indicates a completely new FE. + // If 'image' is not empty, it means an upgrade from a lower version. + File imageDir = new File(this.imageDir); + File[] files = imageDir.listFiles(); + if (files == null || files.length == 0) { + return false; + } + return true; + } + return previousFeVersion.charAt(0) != latestFeVersion.charAt(0); + } + + private void initVersionInfo() { + File folder = new File(versionDir); + File[] files = folder.listFiles(); + int previousSeq = 0; + if (files != null) { + for (File file : files) { + String[] splitArr = file.getName().split("-"); Review Comment: add comment here to describe the version file name and every part meaning -- 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