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 2020/09/01 07:03:04 UTC

[GitHub] [incubator-iotdb] qiaojialin commented on pull request #1665: IOTDB-851: enhance failure tolerance when recover WAL

qiaojialin commented on pull request #1665:
URL: https://github.com/apache/incubator-iotdb/pull/1665#issuecomment-684500274


   Here is one case
   
   @Test
     public void testRecoverWALMismatchDataType()
         throws Exception {
       EnvironmentUtils.envSetUp();
       Class.forName(Config.JDBC_DRIVER_NAME);
   
       try(Connection connection = DriverManager
           .getConnection(Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root",
               "root");
           Statement statement = connection.createStatement()){
         statement.execute("insert into root.turbine1.d1(timestamp,s1,s2) values(1,1.1,2.2);");
         statement.execute("delete timeseries root.turbine1.d1.s1;");
         statement.execute("create timeseries root.turbine1.d1.s1 with datatype=INT32, encoding=RLE, compression=SNAPPY;");
       }
   
       EnvironmentUtils.restartDaemon();
   
   
       try(Connection connection = DriverManager
           .getConnection(Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root",
               "root");
           Statement statement = connection.createStatement()){
   
         boolean hasResultSet = statement.execute("select * from root");
         assertTrue(hasResultSet);
         ResultSet resultSet = statement.getResultSet();
         int cnt = 0;
         while (resultSet.next()) {
           cnt++;
         }
         assertEquals(1, cnt);
       }
   
       EnvironmentUtils.cleanEnv();
     }


----------------------------------------------------------------
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.

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