private boolean needRetry(TSStatus failureStatus) {
    return failureStatus != null
        && queryType == QueryType.READ
        && (failureStatus.getCode() == TSStatusCode.DISPATCH_ERROR.getStatusCode()
            || failureStatus.getCode()
                == TSStatusCode.TOO_MANY_CONCURRENT_QUERIES_ERROR.getStatusCode());
  }
QueryScheduler is used to dispatch the fragment instances of a query to target nodes. And it will
continue to collect and monitor the query execution before the query is finished.

<p>Later, we can add more control logic for a QueryExecution such as retry, kill and so on by
this scheduler.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/scheduler/ClusterScheduler.java