From b07ce175de45d96321859e2f4fb0719396df692c Mon Sep 17 00:00:00 2001 From: Yongqiang YANG <98214048+dataroaring@users.noreply.github.com> Date: Sun, 31 Dec 2023 22:25:25 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"[fix](move-memtable)=20only=20check?= =?UTF-8?q?=20missing=20tablets=20when=20commit=20i=E2=80=A6=20(#29352)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Revert "[fix](move-memtable) only check missing tablets when commit info is not empty (#29326)" This reverts commit 4634c723d7fb86f434060c0e6fa6168d92630cb9. * Revert "[fix](move-memtable) check missing tablets before commit (#29223)" This reverts commit fb0ed8c253f5241c23c71fb88f031604b0bf5a1f. --- be/src/vec/sink/writer/vtablet_writer_v2.cpp | 23 -------------------- be/src/vec/sink/writer/vtablet_writer_v2.h | 2 +- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/be/src/vec/sink/writer/vtablet_writer_v2.cpp b/be/src/vec/sink/writer/vtablet_writer_v2.cpp index b0a39ac2a76338..2550fb172c57c1 100644 --- a/be/src/vec/sink/writer/vtablet_writer_v2.cpp +++ b/be/src/vec/sink/writer/vtablet_writer_v2.cpp @@ -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())); @@ -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) { diff --git a/be/src/vec/sink/writer/vtablet_writer_v2.h b/be/src/vec/sink/writer/vtablet_writer_v2.h index 37558974197548..e99bbd92696cfb 100644 --- a/be/src/vec/sink/writer/vtablet_writer_v2.h +++ b/be/src/vec/sink/writer/vtablet_writer_v2.h @@ -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 _missing_tablets; + std::unordered_set _opened_partitions; std::unordered_map> _tablets_for_node; std::unordered_map> _indexes_from_node;