iotdb icon indicating copy to clipboard operation
iotdb copied to clipboard

After restart, the aligned series turns to non-aligned in 0.13.0

Open DanielWang2035 opened this issue 3 years ago • 2 comments

iotdb 0.13.0用Java原生接口创建对齐序列后,重启后对齐序列变成非对齐。

复现代码:

SessionPool pool = null;
try {
  pool = new SessionPool("127.0.0.1", 6667, "root", "root", 16);
  List<String> str_list = new ArrayList<>();
  str_list.add("at1");
  List<TSDataType> type_list = new ArrayList<>();
  type_list.add(TSDataType.FLOAT);
  List<TSEncoding> encoding_list = new ArrayList<>();
  encoding_list.add(TSEncoding.GORILLA);
  List<CompressionType> compression_type_list = new ArrayList<>();
  compression_type_list.add(CompressionType.SNAPPY);
  pool.createSchemaTemplate("t1", str_list, type_list, encoding_list, compression_type_list, true);
  pool.addAlignedMeasurementInTemplate("t1", "at2", TSDataType.FLOAT, TSEncoding.GORILLA, CompressionType.SNAPPY);
  pool.addAlignedMeasurementInTemplate("t1", "at3", TSDataType.FLOAT, TSEncoding.GORILLA, CompressionType.SNAPPY);

  pool.executeNonQueryStatement("set template t1 to root.SG1");
  pool.executeNonQueryStatement("create timeseries of schema template on root.SG1.a");
} catch (IoTDBConnectionException | StatementExecutionException | IOException e) {
  e.printStackTrace();
} finally {
  if (pool != null)
    pool.close();
}

注意到代码中创建template时只有一个物理量,创建完后又增加了两个。此时show devices可见isAligned=true,但重启iotdb后再show devices,发现isAligned=false。 推测:iotdb读日志重建schema时,读到创建template的语句,发现只有一个物理量,会自动设置为非对齐。但实际上应该有三个物理量,改成非对齐会导致未知错误。

iotdb版本:0.13.0 操作系统:Windows10和Ubuntu均有此问题。

DanielWang2035 avatar Aug 09 '22 10:08 DanielWang2035

Hi, thanks for your issue! I have put forward a PR trying to fix this, PLTA https://github.com/apache/iotdb/pull/6950

bigreybear avatar Aug 10 '22 07:08 bigreybear

Hi, the issue should have been fixed by the latest commit on rel/0.13, you can try it later.

bigreybear avatar Aug 11 '22 02:08 bigreybear