Scheduled pipelines never process records whose _timestamp is exactly on a window boundary
Bug Description
A scheduled pipeline never reads a record whose _timestamp falls exactly on the boundary between two of its runs. From the second run on, each run starts its query 1 µs after the previous run's window ended, and the search treats a window's end as exclusive, so that microsecond belongs to neither run. The record never reaches the destination stream, and nothing reports it.
handle_derived_stream_triggers starts each window 1 µs after the saved end (handlers.rs:4253-4255):
let start_time = new_trigger_data
.period_end_time
.map(|period_end_time| period_end_time + 1);The saved end is the previous run's window end (:4653, :4666, written back as period_end_time at :4672-4676). The search keeps _timestamp >= start_time AND _timestamp < end_time (apply_combined_filter, helpers.rs:306-316). So one run reads up to but not including E, and the next starts at E + 1.
Reproduced on a single node built from main (details below). A pipeline copies pipe_boundary_src to pipe_boundary_dst every minute with SELECT * FROM "pipe_boundary_src" (period 1, frequency 1). The source holds two records per minute, one exactly on the minute and one at :30. After the runs covered 07:18–07:24 UTC:
_timestamp (UTC) kind in destination
2026-09-29T07:18:00.000000Z boundary MISSING
2026-09-29T07:18:30.000000Z mid yes
2026-09-29T07:19:00.000000Z boundary MISSING
2026-09-29T07:19:30.000000Z mid yes
2026-09-29T07:20:00.000000Z boundary MISSING
2026-09-29T07:20:30.000000Z mid yes
2026-09-29T07:21:00.000000Z boundary MISSING
2026-09-29T07:21:30.000000Z mid yes
2026-09-29T07:22:00.000000Z boundary MISSING
2026-09-29T07:22:30.000000Z mid yes
2026-09-29T07:23:00.000000Z boundary MISSING
2026-09-29T07:23:30.000000Z mid yes
source rows: 12 destination rows: 6The pipeline's run records in the _meta org's triggers stream show the gap. Eight of the nine runs start 1 µs after the previous run's end. Only the first, which has no saved period_end_time, starts exactly on its window start:
run start_time end_time
07:16:59 07:15:00.000000 07:16:00.000000 <- first run, no saved period_end_time
07:17:59 07:16:00.000001 07:17:00.000000
07:18:59 07:17:00.000001 07:18:00.000000
07:19:59 07:18:00.000001 07:19:00.000000
07:20:59 07:19:00.000001 07:20:00.000000From its second run on, every scheduled pipeline leaves this 1 µs hole at each boundary. It costs data whenever a record carries exactly that timestamp:
- A source whose timestamps have whole-second precision loses every record from each boundary second, since non-cron window ends are aligned to the period.
- A pipeline reading another pipeline's
histogram()output would lose the row stamped at the start of each window, one row in five for a 5-minute rollup of 1-minute buckets. I have not reproduced this case; it follows from the same boundary.
The handler's own comment describes back-to-back windows, 5:10–5:15pm then 5:15–5:20pm (:4340-4346), and backfill in the same file already advances without the + 1 (query_start_time = backfill_job.current_position at :5354, current_position = chunk_end at :5886). Starting the next window at period_end_time would make scheduled runs contiguous the same way. The guard at :4394 is a strict <, so a run whose window would be empty is still skipped, as today.
Priority
P1 - High
Severity
Major
Related Story/Issue
Not Available
Is this a regression?
Unknown. I have not checked when the + 1 was added.
Steps to Reproduce (Optional)
On a single node with default settings:
POST /api/default/pipe_boundary_src/_jsonwith two records per minute for six consecutive minutes starting at least a minute ahead, one on the minute and one 30 s later, e.g.{"_timestamp": 1790666280000000, "kind": "boundary"}and{"_timestamp": 1790666310000000, "kind": "mid"}.POST /api/default/pipelineswith a scheduled pipeline: aquerynode withSELECT * FROM "pipe_boundary_src"and"trigger_condition": {"period": 1, "frequency": 1, "frequency_type": "minutes"}, and astreamoutput node forpipe_boundary_dst.- Once the runs have passed the last minute, compare
SELECT _timestamp, kind FROM "pipe_boundary_src"with the same query onpipe_boundary_dst.
Expected: all 12 records in pipe_boundary_dst.
Actual: only the 6 mid records. Every record stamped exactly on a minute is missing.
Environment Details
Version: main at 6ace69877 (Cargo.toml 0.93.0), debug build; the code above is unchanged on 97c0905ac, which the links point to
Deployment: single node, ZO_LOCAL_MODE=true, local disk; defaults except ZO_HTTP_PORT, ZO_GRPC_PORT, ZO_DATA_DIR and ZO_TELEMETRY
Reproduced: against a running server, 2026-09-29Which OpenObserve Functionalities Are Affected?
- Home & Login
- Logs / Metrics / Traces
- Dashboards
- Alerts
- Streams, Pipelines & Functions
- Ingestion
- Real User Monitoring (RUM)
- Reports
- IAM & Management
- UI / Styling
- Unknown / Other
Source: openobserve/openobserve