Skip to content

Commit

Permalink
Revert "[fix](move-memtable) only check missing tablets when commit i… (
Browse files Browse the repository at this point in the history
#29352)

* Revert "[fix](move-memtable) only check missing tablets when commit info is not empty (#29326)"

This reverts commit 4634c72.

* Revert "[fix](move-memtable) check missing tablets before commit (#29223)"

This reverts commit fb0ed8c.
  • Loading branch information
dataroaring authored Dec 31, 2023
1 parent 3c6c652 commit b07ce17
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
23 changes: 0 additions & 23 deletions be/src/vec/sink/writer/vtablet_writer_v2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,32 +549,10 @@ Status VTabletWriterV2::close(Status exec_status) {
TTabletCommitInfo commit_info;
commit_info.tabletId = tablet_id;
commit_info.backendId = node_id;
_missing_tablets.erase(tablet_id);
tablet_commit_infos.emplace_back(std::move(commit_info));
}
}
}
if (!tablet_commit_infos.empty() && !_missing_tablets.empty()) {
std::stringstream ss;
ss << "pre-commit check failed, missing " << _missing_tablets.size() << " tablets:";
int print_limit = 3;
for (auto tablet_id : _missing_tablets | std::ranges::views::take(print_limit)) {
ss << " (tablet_id=" << tablet_id;
auto backends = _location->find_tablet(tablet_id)->node_ids;
ss << ", backend_id=[";
bool first = true;
for (auto& backend_id : backends) {
(first ? ss : ss << ',') << backend_id;
first = false;
}
ss << "])";
}
if (_missing_tablets.size() > print_limit) {
ss << ", ...";
}
LOG(INFO) << ss.str() << ", load_id=" << print_id(_load_id);
return Status::InternalError(ss.str());
}
_state->tablet_commit_infos().insert(_state->tablet_commit_infos().end(),
std::make_move_iterator(tablet_commit_infos.begin()),
std::make_move_iterator(tablet_commit_infos.end()));
Expand Down Expand Up @@ -605,7 +583,6 @@ Status VTabletWriterV2::_close_load(const Streams& streams) {
for (auto [tablet_id, tablet] : _tablets_for_node[node_id]) {
if (_tablet_finder->partition_ids().contains(tablet.partition_id())) {
tablets_to_commit.push_back(tablet);
_missing_tablets.insert(tablet_id);
}
}
for (const auto& stream : streams) {
Expand Down
2 changes: 1 addition & 1 deletion be/src/vec/sink/writer/vtablet_writer_v2.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class VTabletWriterV2 final : public AsyncResultWriter {
RuntimeState* _state = nullptr; // not owned, set when open
RuntimeProfile* _profile = nullptr; // not owned, set when open

std::unordered_set<int64_t> _missing_tablets;
std::unordered_set<int64_t> _opened_partitions;

std::unordered_map<int64_t, std::unordered_map<int64_t, PTabletID>> _tablets_for_node;
std::unordered_map<int64_t, std::vector<PTabletID>> _indexes_from_node;
Expand Down

0 comments on commit b07ce17

Please sign in to comment.