iotdb icon indicating copy to clipboard operation
iotdb copied to clipboard

v1.0 百万行数据查询用时间倒序排序出现超时

Open phh2008 opened this issue 3 years ago • 0 comments

问题描述: iotdb V1.0,用程序写入数据库100万条数据 1.查询 select * from root.ln.g1.d3 order by time desc limit 1; 正常返回一条结果。 2.查询 select * from root.ln.g1.d3 order by time desc limit 2; 查询超时 timeout。 一句话描述:在100万条数据库下order by time desc limit 1 查询正常,order by time desc limit 2 查询超时。

复现步骤: Starting IoTDB Cli


|_ | | _ _ || _ .|_ _ \ | | .--.|_/ | | \_| | | . \ | |) | | | / .'`\ \ | | | | | | | __'. | || _. | | | | |.' /| |) | ||'..' || |.'|______/ version 1.0.0 (Build: fbbca3f-dev)

Successfully login at 127.0.0.1:6667 IoTDB> select count(*) from root.ln.g1.d3 +-------------------------+--------------------------------+---------------------------+ |count(root.ln.g1.d3.name)|count(root.ln.g1.d3.temperature)|count(root.ln.g1.d3.status)| +-------------------------+--------------------------------+---------------------------+ | 1000000| 1000000| 1000000| +-------------------------+--------------------------------+---------------------------+ Total line number = 1 It costs 0.107s IoTDB> select * from root.ln.g1.d3 order by time desc limit 1; +-----------------------------+------------------+-------------------------+--------------------+ | Time|root.ln.g1.d3.name|root.ln.g1.d3.temperature|root.ln.g1.d3.status| +-----------------------------+------------------+-------------------------+--------------------+ |2022-12-05T19:01:56.989+08:00| tom| 39.0| false| +-----------------------------+------------------+-------------------------+--------------------+ Total line number = 1 It costs 0.066s IoTDB> select * from root.ln.g1.d3 order by time desc limit 2; Msg: 301: FragmentInstance 20221207_033428_00010_1.1.0 is aborted by timeout IoTDB>

iotdb错误日志打印: 2022-12-07 11:35:28,437 [pool-45-IoTDB-ClientRPC-Processor-2] WARN o.a.i.d.u.ErrorHandlingUtils:90 - Status code: 301, Query Statement: "select * from root.ln.g1.d3 order by time desc limit 2". executeStatement failed org.apache.iotdb.commons.exception.IoTDBException: org.apache.iotdb.db.mpp.execution.schedule.FragmentInstanceAbortedException: FragmentInstance 20221207_033428_00010_1.1.0 is aborted by timeout at org.apache.iotdb.db.mpp.plan.execution.QueryExecution.dealWithException(QueryExecution.java:430) at org.apache.iotdb.db.mpp.plan.execution.QueryExecution.getResult(QueryExecution.java:413) at org.apache.iotdb.db.mpp.plan.execution.QueryExecution.getByteBufferBatchResult(QueryExecution.java:448) at org.apache.iotdb.db.utils.QueryDataSetUtils.convertQueryResultByFetchSize(QueryDataSetUtils.java:387) at org.apache.iotdb.db.service.thrift.impl.ClientRPCServiceImpl.lambda$static$0(ClientRPCServiceImpl.java:160) at org.apache.iotdb.db.service.thrift.impl.ClientRPCServiceImpl.executeStatementInternal(ClientRPCServiceImpl.java:236) at org.apache.iotdb.db.service.thrift.impl.ClientRPCServiceImpl.executeStatementV2(ClientRPCServiceImpl.java:390) at org.apache.iotdb.service.rpc.thrift.IClientRPCService$Processor$executeStatementV2.getResult(IClientRPCService.java:3453) at org.apache.iotdb.service.rpc.thrift.IClientRPCService$Processor$executeStatementV2.getResult(IClientRPCService.java:3433) at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:38) at org.apache.iotdb.db.service.thrift.ProcessorWithMetrics.process(ProcessorWithMetrics.java:64) at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:248) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: org.apache.iotdb.db.mpp.execution.schedule.FragmentInstanceAbortedException: FragmentInstance 20221207_033428_00010_1.1.0 is aborted by timeout at org.apache.iotdb.db.mpp.execution.schedule.DriverScheduler.clearDriverTask(DriverScheduler.java:246) at org.apache.iotdb.db.mpp.execution.schedule.DriverScheduler.access$900(DriverScheduler.java:54) at org.apache.iotdb.db.mpp.execution.schedule.DriverScheduler$Scheduler.toAborted(DriverScheduler.java:390) at org.apache.iotdb.db.mpp.execution.schedule.DriverTaskTimeoutSentinelThread.execute(DriverTaskTimeoutSentinelThread.java:77) at org.apache.iotdb.db.mpp.execution.schedule.AbstractDriverThread.run(AbstractDriverThread.java:74) 2022-12-07 11:35:28,438 [pool-45-IoTDB-ClientRPC-Processor-2$20221207_033428_00010_1] INFO o.a.i.d.m.p.Coordinator:206 - Cost: 60004 ms, sql is select * from root.ln.g1.d3 order by time desc limit 2 2022-12-07 11:35:28,438 [Query-Worker-Thread-3$20221207_033428_00010_1.2.0] WARN o.a.i.d.m.e.e.SharedTsBlockQueue:143 - queue has been destroyed 2022-12-07 11:35:28,439 [Query-Worker-Thread-3$20221207_033428_00010_1.2.0] WARN o.a.i.d.m.e.e.SharedTsBlockQueue:101 - queue has been destroyed 2022-12-07 11:35:34,389 [1-server-thread4] INFO o.a.r.s.i.RaftServerImpl:1045 - 1@group-000200000000: takeSnapshotAsync SnapshotManagementRequest:client-E428A7D96D86->1@group-000200000000, cid=8, seq=0, RO, null, Create: 2022-12-07 11:35:34,389 [1-server-thread4] INFO o.a.ratis.conf.ConfUtils:46 - raft.server.snapshot.creation.gap = 1024 (default) 2022-12-07 11:35:34,389 [pool-37-IoTDB-ratis-bg-disk-guardian-1] INFO o.a.i.c.r.RatisConsensus:709 - Raft group group-000200000000 took snapshot successfully 2022-12-07 11:37:34,405 [1-server-thread5] INFO o.a.r.s.i.RaftServerImpl:1045 - 1@group-000200000000: takeSnapshotAsync SnapshotManagementRequest:client-E428A7D96D86->1@group-000200000000, cid=9, seq=0, RO, null, Create: 2022-12-07 11:37:34,406 [1-server-thread5] INFO o.a.ratis.conf.ConfUtils:46 - raft.server.snapshot.creation.gap = 1024 (default) 2022-12-07 11:37:34,407 [pool-37-IoTDB-ratis-bg-disk-guardian-1] INFO o.a.i.c.r.RatisConsensus:709 - Raft group group-000200000000 took snapshot successfully

** data文件下载地址:** https://share.weiyun.com/lPqqYPE6

phh2008 avatar Dec 07 '22 03:12 phh2008