From 81404014cae98b382b0da6642340fe8d122859bd Mon Sep 17 00:00:00 2001 From: lihangyu <15605149486@163.com> Date: Mon, 23 Sep 2024 10:19:05 +0800 Subject: [PATCH] [Fix](topn) avoid missmatched row count when upgrading (#41000) --- be/src/exec/rowid_fetcher.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/be/src/exec/rowid_fetcher.cpp b/be/src/exec/rowid_fetcher.cpp index 9915f1b626a21b..6ca790aed99b63 100644 --- a/be/src/exec/rowid_fetcher.cpp +++ b/be/src/exec/rowid_fetcher.cpp @@ -241,6 +241,10 @@ Status RowIDFetcher::fetch(const vectorized::ColumnPtr& column_row_ids, std::vector rows_locs; rows_locs.reserve(rows_locs.size()); RETURN_IF_ERROR(_merge_rpc_results(mget_req, resps, cntls, res_block, &rows_locs)); + if (rows_locs.size() < column_row_ids->size()) { + return Status::InternalError("Miss matched return row loc count {}, expected {}, input {}", + rows_locs.size(), res_block->rows(), column_row_ids->size()); + } // Final sort by row_ids sequence, since row_ids is already sorted if need std::map positions; for (size_t i = 0; i < rows_locs.size(); ++i) {