Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion be/src/olap/storage_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,8 @@ void StorageEngine::perform_base_compaction() {
OLAPStatus res = base_compaction.init(best_tablet);
if (res != OLAP_SUCCESS) {
LOG(WARNING) << "failed to init base compaction."
<< "tablet=" << best_tablet->full_name();
<< " tablet=" << best_tablet->full_name()
<< " res=" << res;
return;
}

Expand Down
3 changes: 2 additions & 1 deletion be/src/olap/tablet_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,8 @@ OLAPStatus TabletManager::start_trash_sweep() {
OLAPStatus check_st = TabletMetaManager::get_header((*it)->data_dir(),
(*it)->tablet_id(), (*it)->schema_hash(), new_tablet_meta);
if (check_st == OLAP_SUCCESS) {
if (new_tablet_meta->tablet_state() != TABLET_SHUTDOWN) {
if (new_tablet_meta->tablet_state() != TABLET_SHUTDOWN
|| new_tablet_meta->tablet_uid() != (*it)->tablet_uid()) {
LOG(WARNING) << "tablet's state changed to normal, skip remove dirs"
<< " tablet id = " << new_tablet_meta->tablet_id()
<< " schema hash = " << new_tablet_meta->schema_hash()
Expand Down
7 changes: 5 additions & 2 deletions be/src/olap/txn_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ OLAPStatus TxnManager::commit_txn(
LOG(INFO) << "find transaction exists when add to engine."
<< "partition_id: " << key.first
<< ", transaction_id: " << key.second
<< ", tablet: " << tablet_info.to_string();
<< ", tablet: " << tablet_info.to_string()
<< ", rowset_id: " << load_info.rowset->rowset_id();
return OLAP_SUCCESS;
} else if (load_info.load_id.hi() == load_id.hi()
&& load_info.load_id.lo() == load_id.lo()
Expand All @@ -169,7 +170,9 @@ OLAPStatus TxnManager::commit_txn(
LOG(WARNING) << "find transaction exists when add to engine."
<< "partition_id: " << key.first
<< ", transaction_id: " << key.second
<< ", tablet: " << tablet_info.to_string();
<< ", tablet: " << tablet_info.to_string()
<< ", exist rowset_id: " << load_info.rowset->rowset_id()
<< ", new rowset_id: " << rowset_ptr->rowset_id();
return OLAP_ERR_PUSH_TRANSACTION_ALREADY_EXIST;
}
}
Expand Down
4 changes: 4 additions & 0 deletions be/src/util/uid_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ struct UniqueId {
return hi == rhs.hi && lo == rhs.lo;
}

bool operator!=(const UniqueId& rhs) const {
return hi != rhs.hi || lo != rhs.lo;
}

TUniqueId to_thrift() const {
TUniqueId tid;
tid.__set_hi(hi);
Expand Down
16 changes: 16 additions & 0 deletions be/test/util/uid_util_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,22 @@ TEST_F(UidUtilTest, UniqueId) {
UniqueId id2("002bdc546291f4b1", "015ee2a321ce7d15");
ASSERT_TRUE(id == id2);
}

{
TUniqueId tuid;
tuid.__set_hi(12345678987654321);
tuid.__set_lo(98765432123456789);
UniqueId id(tuid);
std::stringstream ss;
ss << id;
ASSERT_STREQ("002bdc546291f4b1:015ee2a321ce7d15", ss.str().c_str());
UniqueId id2("002bdc546291f4b1", "015ee2a321ce7d15");
ASSERT_TRUE(id == id2);
ASSERT_FALSE(id != id2);
UniqueId id3("002bdc546291f4b1", "015ee2a321ce7d16");
ASSERT_TRUE(id != id3);
ASSERT_FALSE(id == id3);
}
}

TEST_F(UidUtilTest, Hash) {
Expand Down