Skip to content

Commit

Permalink
[chore](femetaversion) add a check in fe code to avoid fe meta versio…
Browse files Browse the repository at this point in the history
…n changed during pick PR (#35039)

* [chore](femetaversion) add a check in fe code to avoid fe meta version changed during pick PR

* f

* f

---------

Co-authored-by: yiguolei <yiguolei@gmail.com>
  • Loading branch information
yiguolei and Doris-Extras committed May 20, 2024
1 parent 9a7f05c commit 6e2e95d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions fe/fe-core/src/main/java/org/apache/doris/DorisFE.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.apache.doris.common.CommandLineOptions;
import org.apache.doris.common.Config;
import org.apache.doris.common.FeConstants;
import org.apache.doris.common.FeMetaVersion;
import org.apache.doris.common.LdapConfig;
import org.apache.doris.common.Log4jConfig;
import org.apache.doris.common.ThreadPoolManager;
Expand Down Expand Up @@ -77,6 +78,16 @@ public class DorisFE {
private static FileLock processFileLock;

public static void main(String[] args) {
// Every doris version should have a final meta version, it should not change
// between small releases. Add a check here to avoid mistake.
if (Version.DORIS_FE_META_VERSION > 0
&& FeMetaVersion.VERSION_CURRENT != Version.DORIS_FE_META_VERSION) {
System.err.println("This release's fe meta version should be "
+ Version.DORIS_FE_META_VERSION
+ " but it is " + FeMetaVersion.VERSION_CURRENT
+ ". It should not change, or FE could not rollback in this version");
return;
}
StartupOptions options = new StartupOptions();
options.enableHttpServer = true;
options.enableQeService = true;
Expand Down
3 changes: 3 additions & 0 deletions gensrc/script/gen_build_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ build_version_rc_version=""

build_version="${build_version_prefix}-${build_version_major}.${build_version_minor}.${build_version_patch}-${build_version_rc_version}"

# This version is used to check FeMetaVersion is not changed during release
build_fe_meta_version=0
unset LANG
unset LC_CTYPE

Expand Down Expand Up @@ -131,6 +133,7 @@ public class Version {
public static final String DORIS_BUILD_TIME = "${build_time}";
public static final String DORIS_BUILD_INFO = "${build_info}";
public static final String DORIS_JAVA_COMPILE_VERSION = "${java_version_str}";
public static final int DORIS_FE_META_VERSION = ${build_fe_meta_version};
public static void main(String[] args) {
System.out.println("doris_build_version_prefix: " + DORIS_BUILD_VERSION_PREFIX);
Expand Down

0 comments on commit 6e2e95d

Please sign in to comment.