This is an automated email from the ASF dual-hosted git repository.
kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new 3b73cc5f77c [fix](recyclebin) Fix replay erase table NPE (#35649)
3b73cc5f77c is described below
commit 3b73cc5f77c1b6bc82d7ca7681d3c9bc1a35192b
Author: walter <[email protected]>
AuthorDate: Thu May 30 17:35:19 2024 +0800
[fix](recyclebin) Fix replay erase table NPE (#35649)
NPE may occur in some special scenarios so we will take some precautions
here.
---
.../main/java/org/apache/doris/catalog/CatalogRecycleBin.java | 9 ++++++---
1 file changed, 6 insertions(+), 3 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 4300dd38887..bd3524e34ae 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
@@ -419,9 +419,12 @@ public class CatalogRecycleBin extends MasterDaemon
implements Writable {
LOG.info("before replay erase table[{}]", tableId);
RecycleTableInfo tableInfo = idToTable.remove(tableId);
idToRecycleTime.remove(tableId);
- Table table = tableInfo.getTable();
- if (table.getType() == TableType.OLAP) {
- Env.getCurrentEnv().onEraseOlapTable((OlapTable) table, true);
+ // NPE may occur in some special case so we will take some precautions
here.
+ if (tableInfo != null) {
+ Table table = tableInfo.getTable();
+ if (table.getType() == TableType.OLAP &&
!Env.isCheckpointThread()) {
+ Env.getCurrentEnv().onEraseOlapTable((OlapTable) table, true);
+ }
}
LOG.info("replay erase table[{}]", tableId);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]