armink / FlashDB

An ultra-lightweight database that supports key-value and time series data | 一款支持 KV 数据和时序数据的超轻量级数据库
Apache License 2.0
1.84k stars 426 forks source link

tsdb 在空间耗尽 擦除旧数据写入新数据后的两个bug #242

Open cld0815 opened 1 year ago

cld0815 commented 1 year ago

使用的提交: master 最新 (3e441f6c26590eb86051826830b19a715d3d7423)

  1. 调用 fdb_tsdb_init 后,得到的 last_time 值为 0 1695694368420 1695694381118

  2. 调用fdb_tsl_iter_by_time, from < to, to = INT32_MAX, 返回的记录中, 没有从最小的(from)开始取 举例: from = 2000 to = INT32_MAX 取回的记录的 time: 2010, 2000, 2001, .....

上述问题均为flash空间全部写了一遍或更多后, 才出现

谢谢~

armink commented 1 year ago

看着似乎和起始扇区的查找有关系,可否深入分析下问题呢?