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

morningman 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 771221a3f3 [improvement](fe-meta) check the image's meta version 
(#23847)
771221a3f3 is described below

commit 771221a3f312adccdfc39e8beee73ef1df929b10
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 0e2243036c..4066b58775 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
@@ -1773,6 +1773,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