github-actions[bot] commented on code in PR #68234:
URL: https://github.com/apache/doris/pull/68234#discussion_r4056409655
##########
be/test/runtime/fragment_mgr_cross_cluster_cancel_test.cpp:
##########
@@ -226,6 +228,64 @@ TEST(FragmentMgrRerunnableParamsTest,
StopReleasesLastQueryContextRefOutsideLock
delete fragment_mgr;
}
+TEST_F(FragmentMgrCrossClusterCancelTest,
RebuildRestoresFragmentExecutingCount) {
+ auto* fragment_mgr = _exec_env.fragment_mgr();
+ const bool previous_enable_debug_points = config::enable_debug_points;
+ constexpr auto debug_point_name =
"fault_inject::PipelineFragmentContext::prepare.skip";
+ config::enable_debug_points = true;
+ DebugPoints::instance()->add(debug_point_name);
+
+ TUniqueId query_id;
+ query_id.__set_hi(505);
+ query_id.__set_lo(606);
+ constexpr int fragment_id = 1;
+ Defer cleanup([&] {
+ DebugPoints::instance()->remove(debug_point_name);
+ config::enable_debug_points = previous_enable_debug_points;
+ fragment_mgr->remove_pipeline_context({query_id, fragment_id});
+ fragment_mgr->remove_query_context(query_id);
+ });
+
+ TPipelineFragmentParams params;
+ params.__set_query_id(query_id);
+ params.__set_fragment_id(fragment_id);
+ params.__set_need_notify_close(true);
+ params.__set_is_simplified_param(false);
+ TNetworkAddress coord;
+ coord.hostname = "fe-rebuild";
+ coord.port = 9030;
+ params.__set_coord(coord);
+ params.__set_is_nereids(true);
+ params.__set_current_connect_fe(coord);
+ params.__set_fragment_num_on_host(1);
+ params.__set_query_options(_make_min_query_options(/*fe_process_uuid*/
789));
+ params.__set_desc_tbl(_make_min_desc_tbl());
+
+ std::shared_ptr<QueryContext> query_ctx;
+ TPipelineFragmentParamsList parent;
+ ASSERT_TRUE(fragment_mgr
+ ->_get_or_create_query_ctx(params, parent,
QuerySource::INTERNAL_FRONTEND,
+ query_ctx)
+ .ok());
+ ASSERT_NE(query_ctx, nullptr);
+ {
+ std::lock_guard lock(fragment_mgr->_rerunnable_params_lock);
+ auto& info = fragment_mgr->_rerunnable_params_map[{query_id,
fragment_id}];
+ info.params = params;
+ info.query_ctx = query_ctx;
+ }
+
+ const auto count_before_rebuild = get_fragment_executing_count();
+ auto st =
+ fragment_mgr->rerun_fragment({}, query_id, fragment_id,
PRerunFragmentParams::REBUILD);
+ ASSERT_TRUE(st.ok()) << st.to_string();
Review Comment:
[P1] Cover and clean up the prepared-but-unsubmitted failure state. This
test's skip hook leaves `_total_tasks == 0` and then directly erases the
context, but production `fragments_to_reset` can contain multiple child
fragment/BE entries and `_recursive_process()` finishes every REBUILD before
starting any SUBMIT. If A rebuilds successfully and later B returns a
prepare/NotFound/transport error, A has `_total_tasks > 0`, `_closed_tasks ==
0`, and the new count, yet no task was scheduled. Even teardown's FINAL_CLOSE
only clears `_need_notify_close`; no task can later erase/decrement A. This is
independent of the existing replay issue. Please roll back earlier rebuilt
targets or explicitly erase never-submitted PFCs, and add a two-target
partial-failure test that ends with an empty map and baseline count.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]