w41ter commented on code in PR #43403:
URL: https://github.com/apache/doris/pull/43403#discussion_r1842045498
##########
fe/fe-core/src/main/java/org/apache/doris/backup/RestoreJob.java:
##########
@@ -2127,29 +2127,25 @@ private Status allTabletCommitted(boolean isReplay) {
}
private Status dropAllNonRestoredTableAndPartitions(Database db) {
- Set<String> restoredViews = jobInfo.newBackupObjects.views.stream()
- .map(view -> view.name).collect(Collectors.toSet());
try {
for (Table table : db.getTables()) {
long tableId = table.getId();
String tableName = table.getName();
TableType tableType = table.getType();
- if (tableType == TableType.OLAP) {
- BackupOlapTableInfo backupTableInfo =
jobInfo.backupOlapTableObjects.get(tableName);
- if (tableType == TableType.OLAP && backupTableInfo !=
null) {
- // drop the non restored partitions.
- dropNonRestoredPartitions(db, (OlapTable) table,
backupTableInfo);
- } else if (isCleanTables) {
- // otherwise drop the entire table.
- LOG.info("drop non restored table {}, table id: {}.
{}", tableName, tableId, this);
- boolean isForceDrop = false; // move this table into
recyclebin.
- env.getInternalCatalog().dropTableWithoutCheck(db,
table, isForceDrop);
- }
- } else if (tableType == TableType.VIEW && isCleanTables &&
!restoredViews.contains(tableName)) {
- LOG.info("drop non restored view {}, table id: {}. {}",
tableName, tableId, this);
- boolean isForceDrop = false; // move this view into
recyclebin.
- env.getInternalCatalog().dropTableWithoutCheck(db, table,
isForceDrop);
+ BackupOlapTableInfo backupTableInfo =
jobInfo.backupOlapTableObjects.get(tableName);
+ if (tableType != TableType.OLAP && tableType != TableType.ODBC
&& tableType != TableType.VIEW) {
+ continue;
+ }
+ if (tableType == TableType.OLAP && backupTableInfo != null) {
+ // drop the non restored partitions.
+ dropNonRestoredPartitions(db, (OlapTable) table,
backupTableInfo);
+ } else if (isCleanTables) {
+ // otherwise drop the entire table.
+ LOG.info("drop non restored table {}({}). {}", tableName,
tableId, this);
+ boolean isView = false;
+ boolean isForceDrop = false; // move this table into
recyclebin.
+ env.getInternalCatalog().dropTableWithoutCheck(db, table,
isView, isForceDrop);
Review Comment:
@wyxxxcat This patch is staled, please update.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]