刘珍 created IOTDB-3040: ------------------------- Summary: [ TTL ] Expired tsfiles with a TTL of more than 10 hours are not deleted Key: IOTDB-3040 URL: https://issues.apache.org/jira/browse/IOTDB-3040 Project: Apache IoTDB Issue Type: Bug Components: Core/Server Affects Versions: 0.14.0-SNAPSHOT Reporter: 刘珍 Assignee: Jialin Qiao Attachments: config.properties, iotdb-engine.properties, iotdb-env.sh, logback.xml
master_0427_b633df5 问题描述: 长测配置,设置TTL为24小时, grep ttl logs/log_all.log |tail -1 2022-04-29 08:57:07,404 [pool-11-IoTDB-TTL-Check-1] INFO o.a.i.d.e.s.DataRegion:1658 - Removed a file /data/iotdb_data/data/sequence/root.test.g_4/0/0/1651092583331-4021-1-0.tsfile{color:#DE350B} before Sat Sep 01 19:33:53 CST 2018 by ttl{color} (115392194000ms) ./tools/tsfileToolSet/print-tsfile-resource-files.sh 解析sg中第1个resource文件,查看时间戳范围,最大时间戳: device root.test.g_0.d_350, start time 1535749930200 (2018-09-01T05:12:10.200+08:00[Asia/Shanghai]), {color:#DE350B}*end time 1535749948000 (2018-09-01T05:12:28+08:00[Asia/Shanghai])*{color} 有14个小时的过期文件没有被删除,磁盘空间无法释放。 1. 机器信息 私有云172.20.70.14/13 8C32G 数据库,bm配置文件见附件。 长测运行起来之后,24小时,设置TTL: #!/bin/bash #ttl默认大小24小时 ttl=86400000 host=127.0.0.1 port=6667 function setTTLOfSg(){ input_new_ttl=$1 ./sbin/start-cli.sh -h $host -p $port -e "set ttl to root.** $input_new_ttl" } #计算操作系统当前时间和iotdb 序列max_time的差值 function getDiffOfTime(){ # 操作系统当前值 秒 os_now=`date +%s` max_time=`./sbin/start-cli.sh -h $host -p $port -e "show devices limit 1"|grep root|awk -F '|' '{print "./sbin/start-cli.sh -h " host " -p " port " -e \"select max_time(s_0) from " $2 " \" "}' host=$host port=$port|sh|grep "| "|awk -F '|' '{print $2}'` diffTime=$((((os_now*=1000))-max_time)) echo $diffTime } # 2小时校正1次 #sleep 24h for i in {1..40000} do getDiffOfTime new_ttl=$((ttl+diffTime)) echo $new_ttl setTTLOfSg $new_ttl sleep 2h done -- This message was sent by Atlassian Jira (v8.20.7#820007)