liyuheng55555 commented on code in PR #13001:
URL: https://github.com/apache/iotdb/pull/13001#discussion_r1687555855
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/scheduler/FragmentInstanceDispatcherImpl.java:
##########
@@ -434,8 +452,13 @@ private void dispatchLocally(final FragmentInstance
instance)
: readExecutor.execute(groupId, instance);
if (!readResult.isAccepted()) {
LOGGER.warn(readResult.getMessage());
- throw new FragmentInstanceDispatchException(
- RpcUtils.getStatus(TSStatusCode.EXECUTE_STATEMENT_ERROR,
readResult.getMessage()));
+ if (readResult.isNeedRetry()) {
+ throw new FragmentInstanceDispatchException(
+ RpcUtils.getStatus(TSStatusCode.DISPATCH_ERROR,
readResult.getMessage()));
+ } else {
+ throw new FragmentInstanceDispatchException(
+ RpcUtils.getStatus(TSStatusCode.EXECUTE_STATEMENT_ERROR,
readResult.getMessage()));
+ }
Review Comment:
We set two different status code here, but where to handler them ?
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/scheduler/FragmentInstanceDispatcherImpl.java:
##########
@@ -325,7 +327,11 @@ private void dispatchRemoteHelper(final FragmentInstance
instance, final TEndPoi
LOGGER.warn(sendFragmentInstanceResp.message);
if (sendFragmentInstanceResp.isSetNeedRetry()
&& sendFragmentInstanceResp.isNeedRetry()) {
- throw new
RatisReadUnavailableException(sendFragmentInstanceResp.message);
+ if (sendFragmentInstanceResp.message.contains("read")) {
Review Comment:
what does message.contains("read") mean ?
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/scheduler/FragmentInstanceDispatcherImpl.java:
##########
@@ -325,7 +327,11 @@ private void dispatchRemoteHelper(final FragmentInstance
instance, final TEndPoi
LOGGER.warn(sendFragmentInstanceResp.message);
if (sendFragmentInstanceResp.isSetNeedRetry()
&& sendFragmentInstanceResp.isNeedRetry()) {
- throw new
RatisReadUnavailableException(sendFragmentInstanceResp.message);
+ if (sendFragmentInstanceResp.message.contains("read")) {
+ throw new
RatisReadUnavailableException(sendFragmentInstanceResp.message);
+ } else {
+ throw new
ConsensusGroupNotExistException(sendFragmentInstanceResp.message);
+ }
Review Comment:
It will be better if check code CONSENSUS_GROUP_NOT_EXIST here, and throw
UnsupportedOperationException for other code
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/executor/RegionReadExecutor.java:
##########
Review Comment:
Beside RegionReadExecutor, IoTDB also has Region**Write**Executor, does it
need any changes ?
--
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]