You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@iotdb.apache.org by "Eric Pai (Jira)" <ji...@apache.org> on 2021/08/31 08:21:00 UTC

[jira] [Commented] (IOTDB-1402) Support the auto-create-schema mechanism for insertRecords in cluster module

    [ https://issues.apache.org/jira/browse/IOTDB-1402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17407170#comment-17407170 ] 

Eric Pai commented on IOTDB-1402:
---------------------------------

Hi, I have reproduced this bug.

Steps:
 # Setup a cluster with 3 nodes.
 # Create a stroage group manually, e.g. root.sg1
 # Using Session API insertRowsPlan, with one device root.sg1.d1 and one measurement s1.
 # The client throws the execption: 

org.apache.iotdb.rpc.StatementExecutionException: 400: The following errors occurred when executing the query, please retry or contact the DBA: [[304@Node(internalIp:127.0.0.1, metaPort:9003, nodeIdentifier:-1845858207, dataPort:40010, clientPort:6667, clientIp:0.0.0.0):Path [****] does not exist:null]]org.apache.iotdb.rpc.StatementExecutionException: 400: The following errors occurred when executing the query, please retry or contact the DBA: [[304@Node(internalIp:127.0.0.1, metaPort:9003, nodeIdentifier:-1845858207, dataPort:40010, clientPort:6667, clientIp:0.0.0.0):Path [m_0 ... m_499] does not exist:null]] at org.apache.iotdb.session.Session.insertRecordsWithLeaderCache(Session.java:1196) at org.apache.iotdb.session.Session.insertRecords(Session.java:1020) at WriteThread2.run(WriteThread2.java:91) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

 

And I have found the root cause:

[https://github.com/apache/iotdb/blob/ce5330b1744186e1dddd4006eb1d230d42edd9b6/cluster/src/main/java/org/apache/iotdb/cluster/coordinator/Coordinator.java]

In the main loop of method +forwardMultiSubPlan+,
 # The local variable +tmpStatus+ is assigned by calling forwardToSingleGroup, which returns a +{color:#172b4d}TIMESERIES_NOT_EXIST(304){color}+ status code, as our expected.
 # The program will go to L553 as it's not +TSStatusCode++.MULTIPLE_ERROR+.
 # Before calling concludeFinalStatus, we can see that the error status code 304 is missed(not set in subStatus array), thus we lost the 304 code fter the return statement.
 # In forwardPlan, the L370 check is failed, so no timeseries auto creation happens.

I think the best solution is to handle the multi status code correctly in +forwardMultiSubPlan.+

Does anyone handle this issue? If not I may help to fix this.

 

 

> Support the auto-create-schema mechanism for insertRecords in cluster module
> ----------------------------------------------------------------------------
>
>                 Key: IOTDB-1402
>                 URL: https://issues.apache.org/jira/browse/IOTDB-1402
>             Project: Apache IoTDB
>          Issue Type: Bug
>          Components: Core/Cluster
>            Reporter: Xinyu Tan
>            Priority: Major
>         Attachments: image-2021-08-31-15-46-20-284.png
>
>
> On 28 May's commit 363bda92dbdb0f2f4739138ec858c91bb7c81efb, after starting three node single replica cluster, sessionExample insertrecords interface will be written in the failure. This is mainly due to problems with the automatic schema creation logic of InsertRowsPlan in the cluster, which does not handle BatchProcessException well



--
This message was sent by Atlassian Jira
(v8.3.4#803005)