You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2020/04/29 03:20:36 UTC
[incubator-doris] branch master updated: [Bug] Fix bug that NPE
when get table's storage format (#3401)
This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
The following commit(s) were added to refs/heads/master by this push:
new 332a3ac [Bug] Fix bug that NPE when get table's storage format (#3401)
332a3ac is described below
commit 332a3acedc732e883f448a6b0d26c713cc95fe9b
Author: Mingyu Chen <mo...@gmail.com>
AuthorDate: Wed Apr 29 11:20:25 2020 +0800
[Bug] Fix bug that NPE when get table's storage format (#3401)
the OlapTable's tableProperty field may be null, we should handle it carefully.
This is error-prone, I will try to refactor it later.
Fix #3400
---
fe/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java | 2 +-
fe/src/main/java/org/apache/doris/catalog/Catalog.java | 4 ++--
.../java/org/apache/doris/transaction/GlobalTransactionMgr.java | 7 ++++++-
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/fe/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java b/fe/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java
index 1f1c6e1..8b04314 100644
--- a/fe/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java
+++ b/fe/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java
@@ -945,7 +945,7 @@ public class SchemaChangeHandler extends AlterHandler {
} else if (hasIndexChange) {
needAlter = true;
} else if (storageFormat == TStorageFormat.V2) {
- if (olapTable.getTableProperty().getStorageFormat() != TStorageFormat.V2) {
+ if (olapTable.getStorageFormat() != TStorageFormat.V2) {
needAlter = true;
}
}
diff --git a/fe/src/main/java/org/apache/doris/catalog/Catalog.java b/fe/src/main/java/org/apache/doris/catalog/Catalog.java
index df754a6..5fa8c16 100644
--- a/fe/src/main/java/org/apache/doris/catalog/Catalog.java
+++ b/fe/src/main/java/org/apache/doris/catalog/Catalog.java
@@ -3072,7 +3072,7 @@ public class Catalog {
bfColumns, olapTable.getBfFpp(),
tabletIdSet, olapTable.getCopiedIndexes(),
singlePartitionDesc.isInMemory(),
- olapTable.getTableProperty().getStorageFormat());
+ olapTable.getStorageFormat());
// check again
db.writeLock();
@@ -6215,7 +6215,7 @@ public class Catalog {
tabletIdSet,
copiedTbl.getCopiedIndexes(),
copiedTbl.isInMemory(),
- copiedTbl.getTableProperty().getStorageFormat());
+ copiedTbl.getStorageFormat());
newPartitions.add(newPartition);
}
} catch (DdlException e) {
diff --git a/fe/src/main/java/org/apache/doris/transaction/GlobalTransactionMgr.java b/fe/src/main/java/org/apache/doris/transaction/GlobalTransactionMgr.java
index db8bbe6..f7e768b 100644
--- a/fe/src/main/java/org/apache/doris/transaction/GlobalTransactionMgr.java
+++ b/fe/src/main/java/org/apache/doris/transaction/GlobalTransactionMgr.java
@@ -17,7 +17,6 @@
package org.apache.doris.transaction;
-import org.apache.commons.collections.CollectionUtils;
import org.apache.doris.catalog.Catalog;
import org.apache.doris.catalog.Database;
import org.apache.doris.catalog.MaterializedIndex;
@@ -65,6 +64,7 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
+import org.apache.commons.collections.CollectionUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -789,6 +789,11 @@ public class GlobalTransactionMgr implements Writable {
transactionState.setTransactionStatus(TransactionStatus.VISIBLE);
unprotectUpsertTransactionState(transactionState);
txnOperated = true;
+ // TODO(cmy): We found a very strange problem. When delete-related transactions are processed here,
+ // subsequent `updateCatalogAfterVisible()` is called, but it does not seem to be executed here
+ // (because the relevant editlog does not see the log of visible transactions).
+ // So I add a log here for observation.
+ LOG.debug("after set transaction {} to visible", transactionState);
} finally {
writeUnlock();
transactionState.afterStateTransform(TransactionStatus.VISIBLE, txnOperated);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org