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

xuyang pushed a commit to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-1.2-lts by this push:
     new 02278d43617 [branch-1.2](cherry-pick) Add build version in backup 
snapshot info
02278d43617 is described below

commit 02278d436171cf917781fe9ce13326a5dcc7bbf9
Author: xy720 <22125576+xy...@users.noreply.github.com>
AuthorDate: Tue Oct 31 16:36:56 2023 +0800

    [branch-1.2](cherry-pick) Add build version in backup snapshot info
    
    The snapshot info uploaded to S3 obj system by backup job is a json file, 
which is useful for us to get information about this snapshot.
    
    If we add version info to the JSON file, we can know what version of the 
cluster used to manufacture this snapshot was, in order to prevent restoring 
the newer version of the snapshot to the older version of the cluster.
---
 .../src/main/java/org/apache/doris/backup/BackupJobInfo.java   | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/backup/BackupJobInfo.java 
b/fe/fe-core/src/main/java/org/apache/doris/backup/BackupJobInfo.java
index ec622dbdca5..68401ea81e7 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/backup/BackupJobInfo.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/backup/BackupJobInfo.java
@@ -33,6 +33,7 @@ import org.apache.doris.catalog.TableIf.TableType;
 import org.apache.doris.catalog.Tablet;
 import org.apache.doris.catalog.View;
 import org.apache.doris.common.FeConstants;
+import org.apache.doris.common.Version;
 import org.apache.doris.common.io.Text;
 import org.apache.doris.common.io.Writable;
 import org.apache.doris.persist.gson.GsonUtils;
@@ -91,6 +92,12 @@ public class BackupJobInfo implements Writable {
 
     @SerializedName("meta_version")
     public int metaVersion;
+    @SerializedName("major_version")
+    public int majorVersion;
+    @SerializedName("minor_version")
+    public int minorVersion;
+    @SerializedName("patch_version")
+    public int patchVersion;
 
     // This map is used to save the table alias mapping info when processing a 
restore job.
     // origin -> alias
@@ -498,6 +505,9 @@ public class BackupJobInfo implements Writable {
         jobInfo.dbId = dbId;
         jobInfo.metaVersion = FeConstants.meta_version;
         jobInfo.content = content;
+        jobInfo.majorVersion = Version.DORIS_BUILD_VERSION_MAJOR;
+        jobInfo.minorVersion = Version.DORIS_BUILD_VERSION_MINOR;
+        jobInfo.patchVersion = Version.DORIS_BUILD_VERSION_PATCH;
 
         Collection<Table> tbls = backupMeta.getTables().values();
         // tbls


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

Reply via email to