shuwenwei opened a new pull request, #11538: URL: https://github.com/apache/iotdb/pull/11538
## Description 1. When a sequence tsfile is flushed, the LastFlushTimeMap will update with the end time of the devices of the tsfile. The method `updateLatestFlushTime` is called here and put the value to LastFlushTimeMap, which is correct in normal cases. However, if the lastFlushTime is modified by `load`, the end time of unsequence space may larger than the sequence space, and the LastFlushTime may be set to a smaller value. 2. When recover the LastFlushTime of a device, TsFileManager will search the sequence files in reverse order and find the last sequence file who contains the device. If the LastFlushTimeMap of a time partition is evicted by FlushCallback of another tsfile and there is a unclosed tsfile in the evicted time partition, the next write of the time partition will recover the LastFlushTime from the unclosed TsFileResource and the result of recovered LastFlushTime is Long.MIN_VALUE. Then, the data of the insertion will enter sequence space through it is unsequence data. To reappear problem2, set the timePartitionInfoMemoryThreshold to very small and the avgSeriesPointNumberThreshold to 2, and execute these sql. <img width="444" alt="截屏2023-11-14 18 08 14" src="https://github.com/apache/iotdb/assets/55970239/4dd69776-1cf8-4bbc-8b47-b6a56f56428a"> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
