This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git

commit db7841aacd569b841ac9821f796fcd2df626e7fe
Author: Mingyu Chen <morning...@163.com>
AuthorDate: Tue Sep 5 19:08:29 2023 +0800

    [improvement](fe-meta) check the image's meta version (#23847)
    
    Sometimes, user may use a low version FE to read high version image, which 
may cause some undefined behavior
    and hard to debug.
    This PR throw an explicit error to notify the user
---
 fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java 
b/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java
index 3f874059fd..554712db8d 100755
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java
@@ -1717,6 +1717,12 @@ public class Env {
 
     public long loadHeaderCOR1(DataInputStream dis, long checksum) throws 
IOException {
         int journalVersion = dis.readInt();
+        if (journalVersion > FeMetaVersion.VERSION_CURRENT) {
+            throw new IOException("The meta version of image is " + 
journalVersion
+                    + ", which is higher than FE current version " + 
FeMetaVersion.VERSION_CURRENT
+                    + ". Please upgrade your cluster to the latest version 
first.");
+        }
+
         long newChecksum = checksum ^ journalVersion;
         MetaContext.get().setMetaVersion(journalVersion);
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to