Skip to content

Commit 5c65762

Browse files
yiguoleilichaoyong
authored and
lichaoyong
committed
Use partition id from base rowset (#1096)
1 parent 91d78ae commit 5c65762

File tree

6 files changed

+16
-5
lines changed

6 files changed

+16
-5
lines changed

be/src/olap/rowset/alpha_rowset.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,10 @@ int64_t AlphaRowset::txn_id() const {
277277
return _rowset_meta->txn_id();
278278
}
279279

280+
int64_t AlphaRowset::partition_id() const {
281+
return _rowset_meta->partition_id();
282+
}
283+
280284
bool AlphaRowset::delete_flag() {
281285
return _rowset_meta->delete_flag();
282286
}

be/src/olap/rowset/alpha_rowset.h

+2
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ class AlphaRowset : public Rowset {
105105

106106
int64_t txn_id() const override;
107107

108+
int64_t partition_id() const override;
109+
108110
// flag for push delete rowset
109111
bool delete_flag() override;
110112

be/src/olap/rowset/rowset.h

+2
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ class Rowset : public std::enable_shared_from_this<Rowset> {
112112
virtual PUniqueId load_id() const = 0;
113113

114114
virtual int64_t txn_id() const = 0;
115+
116+
virtual int64_t partition_id() const = 0;
115117

116118
// flag for push delete rowset
117119
virtual bool delete_flag() = 0;

be/src/olap/schema_change.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,7 @@ OLAPStatus SchemaChangeHandler::schema_version_convert(
14251425
RowsetWriterContext writer_context;
14261426
writer_context.rowset_id = rowset_id;
14271427
writer_context.tablet_id = new_tablet->tablet_id();
1428-
writer_context.partition_id = new_tablet->partition_id();
1428+
writer_context.partition_id = (*base_rowset)->partition_id();
14291429
writer_context.tablet_schema_hash = new_tablet->schema_hash();
14301430
writer_context.rowset_type = ALPHA_ROWSET;
14311431
writer_context.rowset_path_prefix = new_tablet->tablet_path();

be/src/olap/txn_manager.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,12 @@ OLAPStatus TxnManager::commit_txn(
124124
OlapMeta* meta, TPartitionId partition_id, TTransactionId transaction_id,
125125
TTabletId tablet_id, SchemaHash schema_hash,
126126
const PUniqueId& load_id, RowsetSharedPtr rowset_ptr, bool is_recovery) {
127-
DCHECK(partition_id > 0);
128-
DCHECK(transaction_id > 0);
129-
DCHECK(tablet_id > 0);
130-
DCHECK(rowset_ptr != nullptr);
127+
if (partition_id < 1 || transaction_id < 1 || tablet_id < 1) {
128+
LOG(FATAL) << "invalid commit req "
129+
<< " partition_id=" << partition_id
130+
<< " transaction_id=" << transaction_id
131+
<< " tablet_id=" << tablet_id;
132+
}
131133
pair<int64_t, int64_t> key(partition_id, transaction_id);
132134
TabletInfo tablet_info(tablet_id, schema_hash);
133135
if (rowset_ptr == nullptr) {

build.sh

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ ROOT=`dirname "$0"`
3232
ROOT=`cd "$ROOT"; pwd`
3333

3434
export DORIS_HOME=${ROOT}
35+
export BUILD_TYPE=DEBUG
3536
#export BUILD_TYPE=ASAN
3637

3738
. ${DORIS_HOME}/env.sh

0 commit comments

Comments
 (0)