You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/10/10 03:45:08 UTC

[GitHub] [iotdb] DanielWang2035 opened a new issue, #7552: 对齐时间序列与非对齐序列表现不一致

DanielWang2035 opened a new issue, #7552:
URL: https://github.com/apache/iotdb/issues/7552

   **Describe the bug**
   在Java接口中,两个线程同时向一个device中写入数据(自动创建schema)时,用`insertRecords`接口可以正常完成,用`insertAlignedRecords`接口会触发异常`Path already exist`
   
   **To Reproduce**
   复现代码如下:
   ```
     void bug_test() {
       SessionPool pool = new SessionPool("127.0.0.1", 6667, "root", "root", 16);
       SessionDataSetWrapper result = null;
       class MyThread extends Thread{
         int bias = 0;
         
         public MyThread(int bias){
           this.bias = bias;
         }
         
         @Override
         public void run() {
           super.run();
           try {
             ArrayList<String> measurements = new ArrayList<>();
             measurements.add("temperature");
             ArrayList<TSDataType> datatypes = new ArrayList<>();
             datatypes.add(TSDataType.FLOAT);
             
             List<String> paths0 = new ArrayList<>();
             List<Long> times0 = new ArrayList<>();
             List<List<String>> measurements_list0 = new ArrayList<>();
             List<List<TSDataType>> datatypes_list0 = new ArrayList<>();
             List<List<Object>> values_list0 = new ArrayList<>();
             for (int i = 0; i < 10000; i++) {
               ArrayList<Object> values = new ArrayList<>();
               values.add(20.0f);
               
               paths0.add("root.ln.Beijing.Station" + i);
               times0.add((i + 1) * 100 + System.currentTimeMillis());
               measurements_list0.add(measurements);
               datatypes_list0.add(datatypes);
               values_list0.add(values);
               
               // 每500个device调用一次接口
               if (i % 500 == 0 && i > 0){
                 // 将此处改为insertAlignedRecords会出现异常。
                 pool.insertRecords(
                         paths0, times0, measurements_list0, datatypes_list0, values_list0);
                 paths0.clear();
                 times0.clear();
                 measurements_list0.clear();
                 datatypes_list0.clear();
                 values_list0.clear();
               }
             }
           } catch (IoTDBConnectionException e) {
             e.printStackTrace();
           } catch (StatementExecutionException e) {
             e.printStackTrace();
           }
         }
       }
       try {
         MyThread t1 = new MyThread(0);
         MyThread t2 = new MyThread(100);
         t1.start();
         t2.start();
       } finally {
         if (result != null) {
           pool.closeResultSet(result);
         }
       }
     }
   ```
   
   **Expected behavior**
   本代码运行完成后应该有10000个设备,但改为改为insertAlignedRecords后,只有501个设备。
   
   **Desktop (please complete the following information):**
    - OS: Windows 10
    - Version 0.13.0
   
   


-- 
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: reviews-unsubscribe@iotdb.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [iotdb] HTHou closed issue #7552: 对齐时间序列与非对齐序列表现不一致

Posted by GitBox <gi...@apache.org>.
HTHou closed issue #7552: 对齐时间序列与非对齐序列表现不一致
URL: https://github.com/apache/iotdb/issues/7552


-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org