mrproliu opened a new pull request, #1136:
URL: https://github.com/apache/skywalking-banyandb/pull/1136
## Why
`measure` / `stream` / `trace` part chunk-sync receivers used to pass the
raw `ctx.MinTimestamp` straight into `CreateSegmentIfNotExist`. Sidx writes
from the liaison, however, already pass a timestamp aligned to the
segment-interval
grid via `IntervalRule.Standard`.
After [#1120](https://github.com/apache/skywalking-banyandb/pull/1120)
changed the segment-creation timing logic, an off-grid raw timestamp (e.g. a
real `06:00` datapoint inside a 5-day grid) no longer collapsed into the same
aligned
segment that sidx targets. The two paths therefore created / landed in
**different segments** for the same datapoint, leaving part data and its
corresponding sidx out of sync.
## What
- Add `SegmentInterval()` to the `storage.TSDB` interface (lock-safe value
accessor).
- In the part chunk-sync `CreatePartHandler` of all three catalogs
(`measure` / `stream` / `trace`), run the raw `MinTimestamp` through
`tsdb.SegmentInterval().Standard(...)` before calling `CreateSegmentIfNotExist`.
- Regression tests:
- `*_AlignsOffGridMinTimestamp` — DAY(1) + DAY(5) grids confirm off-grid
input is aligned.
- `TestSegmentCreateTS_ConsistencyAcrossPaths` — pre-creates an aligned
historical segment, drives Path A (raw ts) and Path B (liaison-aligned ts), and
asserts they converge.
## Result
Part and sidx writes for the same datapoint always create / look up the same
aligned segment, even when an off-grid raw timestamp arrives at the data node.
--
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]