#14974·openobserve

在本地磁盘上按时间范围删除流数据会删除整个 UTC 日,包括在范围之外的时段

作者: ameyypawar创建于 2026年9月29日更新于 2026年9月29日

Bug Description With local disk storage, the default for a single node (ZO_LOCAL_MODE=true, ZO_LOCAL_MODE_STORAGE=disk), DELETE /api/{org}/streams/{stream}/data_by_time_range deletes whole YYYY/MM/DD directories rather than the requested hours, so hours outside the range are also removed. The file list only drops the requested hours, so the other hours of that day stay listed while their files are gone: their data is gone, and queries over those hours return no rows, with is_partial: true and a "not found" error. The API deliberately works in hours for hourly streams (logs, metrics, traces): "we need check the date is hour or day, user can't delete data with minute and second" (stream/src/lib.rs:934). It passes the bounds on as %Y-%m-%dT%H:00:00Z (:953-967). delete_by_date keeps the hour (retention.rs:470-489) and removes exactly those hours from the file list (:514). On local disk it first deletes the directories returned by generate_local_dirs (:491-503), which walks whole days (:696-705):

内容来源: openobserve/openobserve