From 66ba0de29ff8de41794c657fd369bdfb86f64389 Mon Sep 17 00:00:00 2001 From: huanghaibin <284824253@qq.com> Date: Mon, 1 Apr 2024 12:36:15 +0800 Subject: [PATCH] edit --- be/src/vec/sink/writer/vtablet_writer.cpp | 11 +++++++++++ be/src/vec/sink/writer/vtablet_writer.h | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/be/src/vec/sink/writer/vtablet_writer.cpp b/be/src/vec/sink/writer/vtablet_writer.cpp index 404ca882be3db55..4c94b8a42af8524 100644 --- a/be/src/vec/sink/writer/vtablet_writer.cpp +++ b/be/src/vec/sink/writer/vtablet_writer.cpp @@ -1493,11 +1493,22 @@ Status VTabletWriter::close(Status exec_status) { // Due to the non-determinism of compaction, the rowsets of each replica may be different from each other on different // BE nodes. The number of rows filtered in SegmentWriter depends on the historical rowsets located in the correspoding // BE node. So we check the number of rows filtered on each succeccful BE to ensure the consistency of the current load + LOG(INFO) << "status.ok():" << status.ok() + << ",_write_single_replica:" << _write_single_replica + << ",_schema->is_strict_mode():" << _schema->is_strict_mode() + << ",_schema->is_partial_update():" << _schema->is_partial_update() + << ",_schema:" << _schema->debug_string() + << "table id:" << _schema->table_id() << "db_id:" << _schema->db_id(); if (status.ok() && !_write_single_replica && _schema->is_strict_mode() && _schema->is_partial_update()) { if (Status st = index_channel->check_tablet_filtered_rows_consistency(); !st.ok()) { status = st; } else { + if (index_channel->get_tablets_filtered_rows().empty()) { + return Status::InternalError( + "Wrong filtered_rows empty table id = {} db id = {}", + _schema->table_id(), _schema->db_id()); + } _state->set_num_rows_filtered_in_strict_mode_partial_update( index_channel->num_rows_filtered()); } diff --git a/be/src/vec/sink/writer/vtablet_writer.h b/be/src/vec/sink/writer/vtablet_writer.h index c6ab6b49e9285ae..d6d56ee23e4aa61 100644 --- a/be/src/vec/sink/writer/vtablet_writer.h +++ b/be/src/vec/sink/writer/vtablet_writer.h @@ -457,6 +457,10 @@ class IndexChannel { void set_tablets_filtered_rows( const std::vector>& tablets_filtered_rows, int64_t node_id); + std::map>> get_tablets_filtered_rows() { + return _tablets_filtered_rows; + } + int64_t num_rows_filtered() { DCHECK(!_tablets_filtered_rows.empty()); // the Unique table has no roll up or materilized view