iotdb icon indicating copy to clipboard operation
iotdb copied to clipboard

[Bug] 2.0.4版本在服务器内存资源不足时,使用C#的库,按照time>2025-09-25 17:33:10.555条件,查询返回的数据错误,返回的有小于查询条件时间的数据

Open w-s-q opened this issue 3 months ago • 4 comments

Search before asking

  • [x] I searched in the issues and found nothing similar.

Version

os:rocky linux 10.0 iotdb:apach-iotdb v2.0.4 C#程序集:Apach.IoTDB 2.0.2

Describe the bug and provide the minimal reproduce step

string sql=select * from root.edge.device where time>2025-09-25 17:33:10.555 order by time asc limit 128; using var dataSet=await sessionPool.ExecuteQueryStatementAsync(sql,5000); 返回的数据中,存在时间戳小于2025-09-25 17:33:10.555的数据。 dataSet.next()读取行,多行中的数据没有按照时间排序,存在时间乱序现象

What did you expect to see?

按照条件返回正确数据

What did you see instead?

返回数据错误,顺序也不对

Anything else?

No response

Are you willing to submit a PR?

  • [ ] I'm willing to submit a PR!

w-s-q avatar Sep 26 '25 07:09 w-s-q

Hi, this is your first issue in IoTDB project. Thanks for your report. Welcome to join the community!

github-actions[bot] avatar Sep 26 '25 07:09 github-actions[bot]

时间条件可以转成 时间戳格式,来避免时区不同造成问题。 另外可以直接使用 cli 查询看下具体的结果再对比 程序中的

CritasWang avatar Sep 29 '25 11:09 CritasWang

第一个问题可能是时区问题,具体现象:查询不是每次都出现,而是运行一段时间后,偶发出现。查看当时iotdb服务器的资源状况,发现运行内存不足,服务器是4核8g,此时内存占用几乎是100%。 第二个问题是,返回的数据时间比sql条件时间早1毫秒,可能时间精度存在问题。比如查询条件是time>2025-09-25 17:33:10.555,实际上查询出的数据time是2025-09-25 17:33:10.554,同样也是偶发。 cli查询没发现以上问题,推测可能是C#的iotdb库有问题?测试环境是.net8+windows11,vs2022

w-s-q avatar Sep 30 '25 05:09 w-s-q

第一个问题可能是时区问题,具体现象:查询不是每次都出现,而是运行一段时间后,偶发出现。查看当时iotdb服务器的资源状况,发现运行内存不足,服务器是4核8g,此时内存占用几乎是100%。 第二个问题是,返回的数据时间比sql条件时间早1毫秒,可能时间精度存在问题。比如查询条件是time>2025-09-25 17:33:10.555,实际上查询出的数据time是2025-09-25 17:33:10.554,同样也是偶发。 cli查询没发现以上问题,推测可能是C#的iotdb库有问题?测试环境是.net8+windows11,vs2022

可以贴出来有问题的结果和语句来看下,把原始的时间戳和 格式化后的都加到日志中,输出出来。这样也能方便确认具体问题

CritasWang avatar Oct 09 '25 03:10 CritasWang