Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions be/src/runtime/tablets_channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ Status TabletsChannel::add_batch(const TabletWriterAddRequest& request,
}
}

size_t row_count = 0;
auto get_send_data = [&]() {
if constexpr (std::is_same_v<TabletWriterAddRequest, PTabletWriterAddBatchRequest>) {
return RowBatch(*_row_desc, request.row_batch());
Expand All @@ -476,6 +477,13 @@ Status TabletsChannel::add_batch(const TabletWriterAddRequest& request,
};

auto send_data = get_send_data();
if constexpr (std::is_same_v<TabletWriterAddRequest, PTabletWriterAddBatchRequest>) {
row_count = send_data.num_rows();
} else {
row_count = send_data.rows();
}
CHECK(row_count == request.tablet_ids_size())
<< "block rows: " << row_count << ", tablet_ids_size: " << request.tablet_ids_size();
google::protobuf::RepeatedPtrField<PTabletError>* tablet_errors =
response->mutable_tablet_errors();
for (const auto& tablet_to_rowidxs_it : tablet_to_rowidxs) {
Expand Down
6 changes: 6 additions & 0 deletions be/src/vec/sink/vtablet_sink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ void VNodeChannel::try_send_block(RuntimeState* state) {
// tablet_ids has already set when add row
request.set_packet_seq(_next_packet_seq);
auto block = mutable_block->to_block();
CHECK(block.rows() == request.tablet_ids_size())
<< "block rows: " << block.rows() << ", tablet_ids_size: " << request.tablet_ids_size();
if (block.rows() > 0) {
SCOPED_ATOMIC_TIMER(&_serialize_batch_ns);
size_t uncompressed_bytes = 0, compressed_bytes = 0;
Expand All @@ -298,6 +300,10 @@ void VNodeChannel::try_send_block(RuntimeState* state) {
_add_block_closure->clear_in_flight();
return;
}
{
vectorized::Block tmp_block(*request.mutable_block());
CHECK(block.rows() == tmp_block.rows());
}
if (compressed_bytes >= double(config::brpc_max_body_size) * 0.95f) {
LOG(WARNING) << "send block too large, this rpc may failed. send size: "
<< compressed_bytes << ", threshold: " << config::brpc_max_body_size
Expand Down