[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
This commit is contained in:
@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user