From d749c23bcde07ed5c773f809b764e1bc58aeb4d8 Mon Sep 17 00:00:00 2001 From: GoGoWen <82132356+GoGoWen@users.noreply.github.com> Date: Sun, 9 Apr 2023 20:04:39 +0800 Subject: [PATCH] [Bugfix](backup) fix show snapshot issue (#17580) when there is no snapshot, should no result shows. --- .../main/java/org/apache/doris/backup/Repository.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/backup/Repository.java b/fe/fe-core/src/main/java/org/apache/doris/backup/Repository.java index 3b5448ddd8..fc0d45b155 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/backup/Repository.java +++ b/fe/fe-core/src/main/java/org/apache/doris/backup/Repository.java @@ -644,8 +644,6 @@ public class Repository implements Writable { info.add(FeConstants.null_string); info.add("ERROR: Failed to get info: " + st.getErrMsg()); } else { - info.add(snapshotName); - List tmp = Lists.newArrayList(); for (RemoteFile file : results) { // __info_2018-04-18-20-11-00.Jdwnd9312sfdn1294343 @@ -657,8 +655,11 @@ public class Repository implements Writable { } tmp.add(disjoinPrefix(PREFIX_JOB_INFO, pureFileName.first)); } - info.add(Joiner.on("\n").join(tmp)); - info.add(tmp.isEmpty() ? "ERROR: no snapshot" : "OK"); + if (!tmp.isEmpty()) { + info.add(snapshotName); + info.add(Joiner.on("\n").join(tmp)); + info.add("OK"); + } } } else { // get specified timestamp