allow cancel waiting dag when parent dag or dag net is canceled
This commit is contained in:
@ -876,9 +876,7 @@ int ObIDag::finish(const ObDagStatus status, bool &dag_net_finished)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
{
|
||||
// If force_cancel_flag is set but status is not DAG_STATUS_ABORT, the final task actually succeed.
|
||||
if (OB_UNLIKELY(force_cancel_flag_ && DAG_STATUS_ABORT == status)) {
|
||||
} else if (OB_FAIL(remove_child_for_parents())) {
|
||||
if (OB_FAIL(remove_child_for_parents())) {
|
||||
COMMON_LOG(WARN, "failed to remove child for parents", K(ret));
|
||||
} else if (OB_FAIL(remove_parent_for_children())) {
|
||||
COMMON_LOG(WARN, "failed to remove parent for children", K(ret));
|
||||
@ -892,6 +890,15 @@ int ObIDag::finish(const ObDagStatus status, bool &dag_net_finished)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void ObIDag::set_force_cancel_flag()
|
||||
{
|
||||
force_cancel_flag_ = true;
|
||||
// dag_net and dags in the same dag net should be canceled too.
|
||||
if (OB_NOT_NULL(dag_net_)) {
|
||||
dag_net_->set_cancel();
|
||||
}
|
||||
}
|
||||
|
||||
int ObIDag::add_child_without_inheritance(ObIDag &child)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
@ -1003,6 +1010,10 @@ ObIDagNet::ObIDagNet(
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* ATTENTION: DO NOT call this function if if this dag has parent dag.
|
||||
* When parent adds child, child will be add into the same dag net with parent.
|
||||
*/
|
||||
int ObIDagNet::add_dag_into_dag_net(ObIDag &dag)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
|
||||
@ -435,7 +435,7 @@ public:
|
||||
}
|
||||
void set_start_time() { start_time_ = ObTimeUtility::fast_current_time(); }
|
||||
int64_t get_start_time() const { return start_time_; }
|
||||
void set_force_cancel_flag() { force_cancel_flag_ = true; }
|
||||
void set_force_cancel_flag();
|
||||
bool get_force_cancel_flag() { return force_cancel_flag_; }
|
||||
int add_child_without_inheritance(ObIDag &child);
|
||||
int add_child_without_inheritance(const common::ObIArray<ObINodeWithChild*> &child_array);
|
||||
|
||||
Reference in New Issue
Block a user