This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 6e2e95ddf51 [chore](femetaversion) add a check in fe code to avoid fe
meta version changed during pick PR (#35039)
6e2e95ddf51 is described below
commit 6e2e95ddf51026cdfa64e6fab4fb654ac7b119b8
Author: yiguolei <[email protected]>
AuthorDate: Mon May 20 13:28:26 2024 +0800
[chore](femetaversion) add a check in fe code to avoid fe meta version
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 <[email protected]>
---
fe/fe-core/src/main/java/org/apache/doris/DorisFE.java | 11 +++++++++++
gensrc/script/gen_build_version.sh | 3 +++
2 files changed, 14 insertions(+)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/DorisFE.java
b/fe/fe-core/src/main/java/org/apache/doris/DorisFE.java
index 816106edf9b..583f20687c6 100755
--- a/fe/fe-core/src/main/java/org/apache/doris/DorisFE.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/DorisFE.java
@@ -21,6 +21,7 @@ import org.apache.doris.catalog.Env;
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;
@@ -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;
diff --git a/gensrc/script/gen_build_version.sh
b/gensrc/script/gen_build_version.sh
index eec7281c449..ce850850e00 100755
--- a/gensrc/script/gen_build_version.sh
+++ b/gensrc/script/gen_build_version.sh
@@ -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
@@ -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);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]