TDengine icon indicating copy to clipboard operation
TDengine copied to clipboard

BUG:Cache bug of the ”last“ function

Open 153952402 opened this issue 1 year ago • 1 comments

Bug Description When querying specified column data through the last function, the obtained value does not match the expectation. The expected value is false, but the value is true. However, not using the last function can query the correct value

To Reproduce Steps to reproduce the behavior:

  1. Prepare an SQL A, and run it every second using a while loop select Switch as property, _ts from device_table where device_id = 'deviceId1' and Switch is not null and _ts >= {T} and _ts < {T+1} order by _ts desc limit 1 offset 0 (tips: device_id is a tag)

  2. Prepare an SQL B, and run it every second using a while loop select device_id, last(Switch) from device_table where device_id in('deviceId1', 'deviceId2', 'deviceId3') group by device_id

  3. Insert new data through the schemaless model,

  4. See error Assume that the initial value of SwitchState is true. After inserting new data, the value becomes false. You will find that the execution result of SQL A will immediately get the latest data 'false', while SQL B will get the expected latest result 'false' only after a varying time of 10-40 seconds.

Environment (please complete the following information):

  • TDengine Version [3.0.7.1]

Additional Context Add any other context about the problem here.

153952402 avatar May 30 '24 03:05 153952402

Uploading 屏幕录制2024-05-30 112331_compressed.mp4…

153952402 avatar May 30 '24 04:05 153952402

此类问题均已在后续版本解决,请升级至目前最新的 3.3.5.8

注意:3.0.7.1 之后的版本,开源版操作系统支持范围参考:https://docs.taosdata.com/reference/supported/

如果不在支持范围,最好更换一下服务器,实在不方便可以使用docker ,具体安装/使用方式可以参考官方文档。

yu285 avatar Mar 17 '25 06:03 yu285