This is an automated email from the ASF dual-hosted git repository.
yiguolei 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 6ae033c47e8 [feature](backup) ignore table that not support type when
backup, and… (#33158)
6ae033c47e8 is described below
commit 6ae033c47e819e41879b849bf312bfa9c478dc90
Author: xueweizhang <[email protected]>
AuthorDate: Sat Apr 13 13:25:00 2024 +0800
[feature](backup) ignore table that not support type when backup, and…
(#33158)
* [feature](backup) ignore table that not support type when backup, and not
report exception
Signed-off-by: nextdreamblue <[email protected]>
* fix
Signed-off-by: nextdreamblue <[email protected]>
---------
Signed-off-by: nextdreamblue <[email protected]>
---
.../src/main/java/org/apache/doris/common/Config.java | 6 ++++++
.../main/java/org/apache/doris/backup/BackupHandler.java | 13 ++++++++++++-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java
b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java
index f5d60377c62..d318b77aa41 100644
--- a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java
+++ b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java
@@ -1458,6 +1458,12 @@ public class Config extends ConfigBase {
@ConfField(mutable = true, masterOnly = true)
public static int max_backup_restore_job_num_per_db = 10;
+ /**
+ * whether to ignore table that not support type when backup, and not
report exception.
+ */
+ @ConfField(mutable = true, masterOnly = true)
+ public static boolean ignore_backup_not_support_table_type = false;
+
/**
* Control the default max num of the instance for a user.
*/
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/backup/BackupHandler.java
b/fe/fe-core/src/main/java/org/apache/doris/backup/BackupHandler.java
index 03865433f6b..fc2b0259f02 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/backup/BackupHandler.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/backup/BackupHandler.java
@@ -384,6 +384,7 @@ public class BackupHandler extends MasterDaemon implements
Writable {
// Check if backup objects are valid
// This is just a pre-check to avoid most of invalid backup requests.
// Also calculate the signature for incremental backup check.
+ List<TableRef> tblRefsNotSupport = Lists.newArrayList();
for (TableRef tblRef : tblRefs) {
String tblName = tblRef.getName().getTbl();
Table tbl = db.getTableOrDdlException(tblName);
@@ -391,7 +392,15 @@ public class BackupHandler extends MasterDaemon implements
Writable {
continue;
}
if (tbl.getType() != TableType.OLAP) {
- ErrorReport.reportDdlException(ErrorCode.ERR_NOT_OLAP_TABLE,
tblName);
+ if (Config.ignore_backup_not_support_table_type) {
+ LOG.warn("Table '{}' is a {} table, can not backup and
ignore it."
+ + "Only OLAP(Doris)/ODBC/VIEW table can be backed
up",
+ tblName, tbl.getType().toString());
+ tblRefsNotSupport.add(tblRef);
+ continue;
+ } else {
+
ErrorReport.reportDdlException(ErrorCode.ERR_NOT_OLAP_TABLE, tblName);
+ }
}
OlapTable olapTbl = (OlapTable) tbl;
@@ -422,6 +431,8 @@ public class BackupHandler extends MasterDaemon implements
Writable {
}
}
+ tblRefs.removeAll(tblRefsNotSupport);
+
// Check if label already be used
long repoId = -1;
if (repository != null) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]