From 036276c1d3ff71d60c9fc6fe85becae5427023a6 Mon Sep 17 00:00:00 2001 From: Lijia Liu Date: Sun, 12 Jun 2022 09:59:38 +0800 Subject: [PATCH] [fix] Do not send drop task when replay drop table (#10062) When doing checkpoint, FE will sends DropTask to BE. This PR prohibit this conduct. --- .../java/org/apache/doris/catalog/CatalogRecycleBin.java | 8 ++++---- .../org/apache/doris/datasource/InternalDataSource.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/CatalogRecycleBin.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/CatalogRecycleBin.java index bbaaeab465..a9c78d5705 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/catalog/CatalogRecycleBin.java +++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/CatalogRecycleBin.java @@ -87,14 +87,14 @@ public class CatalogRecycleBin extends MasterDaemon implements Writable { return true; } - public synchronized boolean recycleTable(long dbId, Table table) { + public synchronized boolean recycleTable(long dbId, Table table, boolean isReplay) { if (idToTable.containsKey(table.getId())) { LOG.error("table[{}] already in recycle bin.", table.getId()); return false; } // erase table with same name - eraseTableWithSameName(dbId, table.getName()); + eraseTableWithSameName(dbId, table.getName(), isReplay); // recycle table RecycleTableInfo tableInfo = new RecycleTableInfo(dbId, table); @@ -196,7 +196,7 @@ public class CatalogRecycleBin extends MasterDaemon implements Writable { } // end for tables } - private synchronized void eraseTableWithSameName(long dbId, String tableName) { + private synchronized void eraseTableWithSameName(long dbId, String tableName, boolean isReplay) { Iterator> iterator = idToTable.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry entry = iterator.next(); @@ -208,7 +208,7 @@ public class CatalogRecycleBin extends MasterDaemon implements Writable { Table table = tableInfo.getTable(); if (table.getName().equals(tableName)) { if (table.getType() == TableType.OLAP) { - Catalog.getCurrentCatalog().onEraseOlapTable((OlapTable) table, false); + Catalog.getCurrentCatalog().onEraseOlapTable((OlapTable) table, isReplay); } iterator.remove(); diff --git a/fe/fe-core/src/main/java/org/apache/doris/datasource/InternalDataSource.java b/fe/fe-core/src/main/java/org/apache/doris/datasource/InternalDataSource.java index 7068cd92d9..8395ebbd63 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/datasource/InternalDataSource.java +++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/InternalDataSource.java @@ -923,7 +923,7 @@ public class InternalDataSource implements DataSourceIf { db.dropTable(table.getName()); if (!isForceDrop) { - Catalog.getCurrentRecycleBin().recycleTable(db.getId(), table); + Catalog.getCurrentRecycleBin().recycleTable(db.getId(), table, isReplay); } else { if (table.getType() == TableType.OLAP) { Catalog.getCurrentCatalog().onEraseOlapTable((OlapTable) table, isReplay);