From 5ad9ddf98de7c4f11651ee10778ae429503e5d06 Mon Sep 17 00:00:00 2001 From: w41ter Date: Thu, 24 Oct 2024 11:47:33 +0000 Subject: [PATCH] fix --- .../src/main/java/org/apache/doris/backup/RestoreJob.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fe/fe-core/src/main/java/org/apache/doris/backup/RestoreJob.java b/fe/fe-core/src/main/java/org/apache/doris/backup/RestoreJob.java index fb7be8963faae54..04cee3faa5dc25d 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/backup/RestoreJob.java +++ b/fe/fe-core/src/main/java/org/apache/doris/backup/RestoreJob.java @@ -111,6 +111,7 @@ import java.util.Set; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; +import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; import java.util.zip.ZipOutputStream; @@ -2436,9 +2437,12 @@ public void write(DataOutput out) throws IOException { ByteArrayOutputStream bytesStream = new ByteArrayOutputStream(); try (ZipOutputStream zipStream = new ZipOutputStream(bytesStream)) { + ZipEntry entry = new ZipEntry("restore_job"); + zipStream.putNextEntry(entry); try (DataOutputStream stream = new DataOutputStream(zipStream)) { writeOthers(stream); } + zipStream.closeEntry(); } Text text = new Text(bytesStream.toByteArray()); if (text.getLength() > (100 << 20)) { @@ -2534,9 +2538,11 @@ public void readFields(DataInput in) throws IOException { ByteArrayInputStream bytesStream = new ByteArrayInputStream(text.getBytes()); try (ZipInputStream zipStream = new ZipInputStream(bytesStream)) { + zipStream.getNextEntry(); try (DataInputStream stream = new DataInputStream(zipStream)) { readOthers(stream); } + zipStream.closeEntry(); } } else { readOthers(in);