[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.
This commit is contained in:
Lijia Liu
2022-06-12 09:59:38 +08:00
committed by GitHub
parent 3f575e3e7c
commit 036276c1d3
2 changed files with 5 additions and 5 deletions

View File

@ -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<Map.Entry<Long, RecycleTableInfo>> iterator = idToTable.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<Long, RecycleTableInfo> 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();

View File

@ -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);