From a3fa4ae4fb3a0eb38d32199dbaaeee187a138857 Mon Sep 17 00:00:00 2001 From: yiguolei Date: Mon, 6 May 2019 14:37:32 +0800 Subject: [PATCH 1/2] Use partition id from base rowset --- be/src/olap/rowset/alpha_rowset.cpp | 4 ++++ be/src/olap/rowset/alpha_rowset.h | 2 ++ be/src/olap/rowset/rowset.h | 2 ++ be/src/olap/schema_change.cpp | 2 +- be/src/olap/txn_manager.cpp | 10 ++++++---- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/be/src/olap/rowset/alpha_rowset.cpp b/be/src/olap/rowset/alpha_rowset.cpp index b44654b18ffd65..61ec1d773d1457 100644 --- a/be/src/olap/rowset/alpha_rowset.cpp +++ b/be/src/olap/rowset/alpha_rowset.cpp @@ -277,6 +277,10 @@ int64_t AlphaRowset::txn_id() const { return _rowset_meta->txn_id(); } +int64_t AlphaRowset::partition_id() const { + return _rowset_meta->partition_id(); +} + bool AlphaRowset::delete_flag() { return _rowset_meta->delete_flag(); } diff --git a/be/src/olap/rowset/alpha_rowset.h b/be/src/olap/rowset/alpha_rowset.h index 12cbc841076d34..ab5d3ba7a18b70 100644 --- a/be/src/olap/rowset/alpha_rowset.h +++ b/be/src/olap/rowset/alpha_rowset.h @@ -105,6 +105,8 @@ class AlphaRowset : public Rowset { int64_t txn_id() const override; + int64_t partition_id() const override; + // flag for push delete rowset bool delete_flag() override; diff --git a/be/src/olap/rowset/rowset.h b/be/src/olap/rowset/rowset.h index ab6965575011b3..ce8e2b3767f0be 100644 --- a/be/src/olap/rowset/rowset.h +++ b/be/src/olap/rowset/rowset.h @@ -112,6 +112,8 @@ class Rowset : public std::enable_shared_from_this { virtual PUniqueId load_id() const = 0; virtual int64_t txn_id() const = 0; + + virtual int64_t partition_id() const = 0; // flag for push delete rowset virtual bool delete_flag() = 0; diff --git a/be/src/olap/schema_change.cpp b/be/src/olap/schema_change.cpp index 132fc918db7b9e..e410f9b7c123b8 100644 --- a/be/src/olap/schema_change.cpp +++ b/be/src/olap/schema_change.cpp @@ -1425,7 +1425,7 @@ OLAPStatus SchemaChangeHandler::schema_version_convert( RowsetWriterContext writer_context; writer_context.rowset_id = rowset_id; writer_context.tablet_id = new_tablet->tablet_id(); - writer_context.partition_id = new_tablet->partition_id(); + writer_context.partition_id = (*base_rowset)->partition_id(); writer_context.tablet_schema_hash = new_tablet->schema_hash(); writer_context.rowset_type = ALPHA_ROWSET; writer_context.rowset_path_prefix = new_tablet->tablet_path(); diff --git a/be/src/olap/txn_manager.cpp b/be/src/olap/txn_manager.cpp index 5d8207a4aaf6bb..19e9eaa325de89 100755 --- a/be/src/olap/txn_manager.cpp +++ b/be/src/olap/txn_manager.cpp @@ -124,10 +124,12 @@ OLAPStatus TxnManager::commit_txn( OlapMeta* meta, TPartitionId partition_id, TTransactionId transaction_id, TTabletId tablet_id, SchemaHash schema_hash, const PUniqueId& load_id, RowsetSharedPtr rowset_ptr, bool is_recovery) { - DCHECK(partition_id > 0); - DCHECK(transaction_id > 0); - DCHECK(tablet_id > 0); - DCHECK(rowset_ptr != nullptr); + if (partition_id < 1 || transaction_id < 1 || tablet_id < 1) { + LOG(FATAL) << "invalid commit req " + << " partition_id=" << partition_id + << " transaction_id=" << transaction_id + << " tablet_id=" << tablet_id; + } pair key(partition_id, transaction_id); TabletInfo tablet_info(tablet_id, schema_hash); if (rowset_ptr == nullptr) { From 49cd9de6dd5249b79f99dd0a0ae6e662c98382a8 Mon Sep 17 00:00:00 2001 From: yiguolei Date: Mon, 6 May 2019 14:47:27 +0800 Subject: [PATCH 2/2] Change build type to debug --- build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build.sh b/build.sh index a6c1ad9f1306d9..7a1df64aa4503c 100755 --- a/build.sh +++ b/build.sh @@ -32,6 +32,7 @@ ROOT=`dirname "$0"` ROOT=`cd "$ROOT"; pwd` export DORIS_HOME=${ROOT} +export BUILD_TYPE=DEBUG #export BUILD_TYPE=ASAN . ${DORIS_HOME}/env.sh