This is an automated email from the ASF dual-hosted git repository. dataroaring pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push: new a5a5b32ba96 [test](move-memtable) add more fault injection cases for writer v2 (#39169) a5a5b32ba96 is described below commit a5a5b32ba9688cad4f4a1b62871909ebed152c5c Author: Kaijie Chen <c...@apache.org> AuthorDate: Fri Aug 23 23:36:26 2024 +0800 [test](move-memtable) add more fault injection cases for writer v2 (#39169) ## Proposed changes Add more fault injection cases for writer v2 to improve coverage. --- be/src/vec/sink/writer/vtablet_writer_v2.cpp | 15 +++++++++------ .../test_writer_v2_fault_injection.groovy | 6 ++++++ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/be/src/vec/sink/writer/vtablet_writer_v2.cpp b/be/src/vec/sink/writer/vtablet_writer_v2.cpp index 057384ab9b9..780ea8283bd 100644 --- a/be/src/vec/sink/writer/vtablet_writer_v2.cpp +++ b/be/src/vec/sink/writer/vtablet_writer_v2.cpp @@ -200,13 +200,11 @@ Status VTabletWriterV2::_init(RuntimeState* state, RuntimeProfile* profile) { return Status::InternalError("unknown destination tuple descriptor, id = {}", _tuple_desc_id); } - DBUG_EXECUTE_IF("VTabletWriterV2._init._vec_output_expr_ctxs_not_equal_output_tuple_slot", { - return Status::InvalidArgument( - "output_tuple_slot_num {} should be equal to output_expr_num {}", - _output_tuple_desc->slots().size() + 1, _vec_output_expr_ctxs.size()); - }); + auto output_tuple_desc_slots_size = _output_tuple_desc->slots().size(); + DBUG_EXECUTE_IF("VTabletWriterV2._init._vec_output_expr_ctxs_not_equal_output_tuple_slot", + { output_tuple_desc_slots_size++; }); if (!_vec_output_expr_ctxs.empty() && - _output_tuple_desc->slots().size() != _vec_output_expr_ctxs.size()) { + _vec_output_expr_ctxs.size() != output_tuple_desc_slots_size) { LOG(WARNING) << "output tuple slot num should be equal to num of output exprs, " << "output_tuple_slot_num " << _output_tuple_desc->slots().size() << " output_expr_num " << _vec_output_expr_ctxs.size(); @@ -289,6 +287,8 @@ Status VTabletWriterV2::_open_streams_to_backend(int64_t dst_id, Streams& stream } auto idle_timeout_ms = _state->execution_timeout() * 1000; std::vector<PTabletID>& tablets_for_schema = _indexes_from_node[node_info->id]; + DBUG_EXECUTE_IF("VTabletWriterV2._open_streams_to_backend.no_schema_when_open_streams", + { tablets_for_schema.clear(); }); int fault_injection_skip_cnt = 0; for (auto& stream : streams) { DBUG_EXECUTE_IF("VTabletWriterV2._open_streams_to_backend.one_stream_open_failure", { @@ -482,6 +482,8 @@ Status VTabletWriterV2::_write_memtable(std::shared_ptr<vectorized::Block> block break; } } + DBUG_EXECUTE_IF("VTabletWriterV2._write_memtable.index_not_found", + { index_not_found = true; }); if (index_not_found) { LOG(WARNING) << "index " << rows.index_id << " not found in schema, load_id=" << print_id(_load_id); @@ -675,6 +677,7 @@ void VTabletWriterV2::_close_wait(bool incremental) { } int64_t remain_ms = static_cast<int64_t>(_state->execution_timeout()) * 1000 - _timeout_watch.elapsed_time() / 1000 / 1000; + DBUG_EXECUTE_IF("VTabletWriterV2._close_wait.load_timeout", { remain_ms = 0; }); if (remain_ms <= 0) { LOG(WARNING) << "load timed out before close waiting, load_id=" << print_id(_load_id); diff --git a/regression-test/suites/fault_injection_p0/test_writer_v2_fault_injection.groovy b/regression-test/suites/fault_injection_p0/test_writer_v2_fault_injection.groovy index eaf87127abc..c0cbd1686eb 100644 --- a/regression-test/suites/fault_injection_p0/test_writer_v2_fault_injection.groovy +++ b/regression-test/suites/fault_injection_p0/test_writer_v2_fault_injection.groovy @@ -85,12 +85,18 @@ suite("test_writer_v2_fault_injection", "nonConcurrent") { load_with_injection("VTabletWriterV2._init._vec_output_expr_ctxs_not_equal_output_tuple_slot", "should be equal to output_expr_num") // VTabletWriterV2 node_info is null load_with_injection("VTabletWriterV2._open_streams_to_backend.node_info_null", "Unknown node") + // VTabletWriterV2 do not get tablet schema on open_streams + load_with_injection("VTabletWriterV2._open_streams_to_backend.no_schema_when_open_streams", "success") // VTabletWriterV2 tablet_location is null load_with_injection("VTabletWriterV2._build_tablet_node_mapping.tablet_location_null", "unknown tablet location") // VTabletWriterV2 location is null load_with_injection("VTabletWriterV2._select_streams.location_null", "failed to open DeltaWriter for tablet") + // VTabletWriterV2 index not found + load_with_injection("VTabletWriterV2._write_memtable.index_not_found", "failed to open DeltaWriter for tablet") // VTabletWriterV2 cancel load_with_injection("VTabletWriterV2.close.cancel", "load cancel") + // VTabletWriterV2 load timeout before close_wait + load_with_injection("VTabletWriterV2._close_wait.load_timeout", "load timed out before close waiting") // DeltaWriterV2 stream_size is 0 load_with_injection("DeltaWriterV2.init.stream_size", "failed to find tablet schema") --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org