Uploaded image for project: 'Apache IoTDB'
  1. Apache IoTDB
  2. IOTDB-3044

[ concurrent delete sg ] There are some timeseries that cannot be deleted

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.14.0-SNAPSHOT
    • None
    • Core/Schema Manager
    • None
    • 2022-5-SchemaManage

    Description

      master_0428_ca4f3cf

      问题描述:
      50sg,500 dev, 200000 sensor/dev

      show devices的结果输出到dev_name.txt
      顺序读取dev_name.txt中的设备名称,一个设备上1次delete 1个ts,10用户并发执行delete。
      有的ts delete不掉。
      日志中记录delete ts的操作,show timeseries还可以看到:

      测试流程
      1. 192.168.10.68 机器 72C256G
      iotdb参数
      MAX_HEAP_SIZE="192G"
      MAX_DIRECT_MEMORY_SIZE="32G"
      schema_engine_mode=Schema_File

      benchmark生成元数据。
      DEVICE_NUMBER=500
      SENSOR_NUMBER=200000
      CLIENT_NUMBER=50
      GROUP_NUMBER=50

      2. 获取devices (放在${iotdb_dir})
      执行脚本
      get_dev_name.sh
      #!/bin/bash
      ./sbin/start-cli.sh -e "show devices;" |grep root|awk -F '|' '

      {print $2}' > dev_name.txt

      3. 启动并行delete (放在${iotdb_dir})
      cat del_ts.sh
      #!/bin/bash
      function delete_ts()
      {
      del_ts=$1
      dev_name=$2
      exp_count=$3
      count_ts ${exp_count} ${dev_name}
      ./sbin/start-cli.sh -e "delete timeseries ${del_ts};"
      let exp_count--
      count_ts ${exp_count} ${dev_name}
      }

      function count_ts()
      {
      exp_c_ts=$1
      dev_name=$2
      cur_c_ts=`./sbin/start-cli.sh -e "count timeseries ${dev_name};"|sed -n "4,4p"|awk -F '|' '{print $2}

      '`
      if [ "${cur_c_ts}" -eq "${exp_c_ts}" ];then
      echo "ok"
      else
      echo "fail. ${dev_name} ${exp_c_ts} ${cur_c_ts}" >>./fail.log
      fi
      }

      function execute()
      {
      in_file=$1
      i=$2
      exp_count=$3
      n=0
      cat ${in_file} | while read line
      do
      del_ts="${line}.s_${i}"
      dev_name="${line}.*";
      delete_ts ${del_ts} ${dev_name} ${exp_count} &
      let i++
      let n++
      b=$(( $n % 10 ))
      if [ "$b" -eq "0" ];then
      wait
      fi
      done
      wait
      }

      function execute_ts_maxID()
      {
      in_file=$1
      maxID=$2
      exp_count=$3
      n=0
      cat ${in_file} | while read line
      do
      del_ts="${line}.s_${maxID}"
      dev_name="${line}.*";
      delete_ts ${del_ts} ${dev_name} ${exp_count} &
      let n++
      b=$(( $n % 10 ))
      if [ "$b" -eq "0" ];then
      wait
      fi
      done
      wait
      }

      count_ts_base=200000

      for loop in

      {0..99}

      do
      idx=$(( $loop * 2000 ))
      execute "dev_name.txt" ${idx} ${count_ts_base}
      let count_ts_base--
      done

      idx=199999
      execute_ts_maxID "dev_name.txt" ${idx} ${count_ts_base}

      不符合预期的结果会打印到fail.log

      根据fail中记录的 ts名称,查看日志,有对应的delete ,show 可以看到没有被delete掉。

      Attachments

        Activity

          People

            bigreybear ZhaoXin
            刘珍 刘珍
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: