Skip to content

Commit

Permalink
fix some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
SWJTU-ZhangLei committed Oct 24, 2024
1 parent 135dff8 commit 86cf70d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cloud/src/meta-service/txn_lazy_committer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@ void TxnLazyCommitTask::commit() {
tmp_rowset_pb;
}

int64_t table_id = -1;
// tablet_id -> TabletIndexPB
std::unordered_map<int64_t, TabletIndexPB> tablet_ids;
for (auto& [partition_id, tmp_rowset_metas] : partition_to_tmp_rowset_metas) {
Expand Down Expand Up @@ -358,9 +357,11 @@ void TxnLazyCommitTask::commit() {
break;
}

int64_t table_id = -1;
DCHECK(tmp_rowset_metas.size() > 0);
if (table_id <= 0) {
if (tablet_ids.size() > 0) {
// get table_id from memory cache
table_id = tablet_ids.begin()->second.table_id();
} else {
// get table_id from storage
Expand Down Expand Up @@ -455,6 +456,10 @@ void TxnLazyCommitTask::commit() {
}
}
}
if (code_ != MetaServiceCode::OK) {
LOG(WARNING) << "txn_id=" << txn_id_ << " code=" << code_ << " msg=" << msg_;
break;
}
make_committed_txn_visible(instance_id_, db_id, txn_id_, txn_kv_, code_, msg_);
} while (false);
} while (code_ == MetaServiceCode::KV_TXN_CONFLICT &&
Expand Down

0 comments on commit 86cf70d

Please sign in to comment.