Skip to content

feat(data_plane): tiered view storage, push precompute by default, faster Remote Write decode - #864

Merged
zzylol merged 22 commits into
mainfrom
land/tiered-view-storage
Nov 24, 2026
Merged

zzylol merged 22 commits into
mainfrom
land/tiered-view-storage

Conversation

@zzylol

@zzylol zzylol commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Lands feat/tiered-view-storage on main: replaces #855 (and #854, which was merged into it), rebased onto main after #852 was squash-merged. The branch feat/tiered-view-storage is kept unchanged. It contains three pieces of work:

  1. Tiered view storage (data-plane: tiered view storage with zero-copy state views #855): view files become time segments per refresh group and retention; decoded windows are cached in memory up to a budget and read back from mapped segments, states read in place.
  2. Push precompute, the default (feat(data_plane): push precompute (design, tests T1-T19, implementation) #854): views are updated as samples arrive (--precompute-mode push, the default; window keeps the runs over each closed window), under a precompute memory budget, with batched pushes.
  3. Faster Remote Write decode (perf(data_plane): Remote Write decode 652 → 212 ns/sample #861): 652 → 212 ns/sample.

It also carries #852's review fixes into the code these change (merged at 18b080bf): the refusal of raw reads that reach evicted samples, the late and extreme-timestamp sample drops, and stopping at an undecodable record now also apply to the cold-tier segment index (6a4d9b4c, with a test).

The sections below are the three PRs' descriptions.

Review fixes (c17ae04..45ef3ef)

Independent reviews by dimension (correctness; dead code and duplication; docs and ASAPPlanner terms; privacy). Fixed, each behavior change with a test that failed first:

Finding Fix
High: with a pushable long group and a window-path short group on one metric, the short group's close made the router drop samples the long group's open window still needed a metric any push group scans is not dropped as late by the router (push shards drop samples of their own sealed windows); raw-data eviction still follows the window-path groups (c17ae04)
The precompute memory budget never applied with two or more push groups each shard reports whether a group has an older window open; with none, a shard over the budget fails its largest open window; docs say nothing waits (7768c9e)
A range reaching before a view's first window was answered from partial data without a declared stream start, and after a restart the floor applies only with a declared stream start and is cleared on restart (346b536)
A recomputed window after a restart could truncate a recovered, mapped segment segments are created with create_new, only once a fragment encodes (00dc34f)
Unchecked offsets and row counts from on-disk record heads checked arithmetic, ranges validated inside the record frame, errors instead of panics (b75213a)
A cache remove racing a load re-inserted the window load does not insert a removed key; the ring is cleaned (414d371)
The push probe could miss a Scan opened after its seal such a group is refused for push (79d3505)
Dead code: the combine-rule table used only by tests, a loader for a segment layout never on main, never-built StoredValue variants, CacheStats.loads, a second value formatter, test-only accessors, hand-parsed enums moved to tests / removed / clap::ValueEnum (078f99b..983b1fb)
Docs: README pin, push default, new flags and metrics, cache default; design-doc process leftovers and stale defaults updated to the code (6324a6a, e5613c1, 45ef3ef)

Not changed: samples a push shard drops for its own sealed windows are counted once by the router as late_for_views, not again; the run instances a group may open before its first seal are not bounded yet.

Follow-ups

  • push_precompute.rs, view_tiering.rs and view_cold_allocations.rs keep their own barrier/metric test helpers; move them to tests/common like the others.

Tiered view storage (#855)

Design: docs/design/tiered-view-storage.md. Implements the approved design and its zero-copy revision: cold view windows are read from mapped segments through state views, never rebuilt. Pins ProjectASAP/ASAPPlanner#1447 (executor: mapped state columns, streaming SummaryMerge) and ProjectASAP/asap_sketchlib#271 (DDSketch, KLL and Count-Min views). B1 results are in the PR comments. With every read cold in a 3 GiB cgroup, the working set is 456 MiB and anon is 352 MiB, against 1300 MiB and 1273 MiB with tiering off, and q01 latency is unchanged (1.1–1.3 s). V22 (compressed samples) waits for the backend codec PR.

Summary

Keep recently read view windows decoded in a bounded heap cache, and serve all other windows from the view files the data plane already writes for recovery: sealed segments are mapped and decoded in place from a columnar format. The persistence files become the cold tier, so each window is encoded and written once. Under a cgroup memory.max the data plane then slows down instead of being OOM-killed, and disk use becomes bounded by retention.

Review guide

  1. The tests (list below): each failed before the implementation for the reason given.
  2. Measured expectations (design section of the same name): without rollup levels the dashboard reads every window at every evaluation, so tiering trades memory for decode CPU there; with rollup levels most fine windows go idle at no query cost.
  3. Decisions (design section): mmap read path, recency hot policy, columnar fragments, no budget without a cgroup limit (idle eviction only), old files renamed *.stale.

Behavior: before → after

Dashboard plan (KLL quantile, Max, Rate, Increase chains, 15 s windows, 1 h retention), 10k series per metric, 1 sample/s, measured in process on a 56-core x86 server:

Before After (estimated before implementation; B1/B2 measure it)
View windows all decoded in the heap: 3.1 GB, RSS 3.9 GB cache bounded by --view-cache-max-bytes (default from the cgroup's memory.max); the rest in the files (1.46 GB per hour today, less with columnar fragments), reclaimable page cache
View files recovery only; one file per group, grows without trimming the same bytes are the cold tier; time segments deleted past retention
Under a small memory.max OOM kill answered; cold reads cost decode time per window (about 31 ms per 10k rows with today's row-wise format), more when the page cache was reclaimed
Restart decodes every window in retention (26 s here) indexes record heads only; first queries decode what they read

Interfaces

 // data_plane/src/engine.rs
 pub struct EngineOptions {
     pub view_sync_interval_ms: u64,
+    /// Bytes of decoded view windows the window cache may hold; `None`: from the cgroup's memory.max, or no budget.
+    pub view_cache_max_bytes: Option<u64>,
+    /// A cached window not read for this long leaves the cache; `None`: 60 s; `Some(0)`: never.
+    pub view_cache_idle_ms: Option<u64>,
+    /// Milliseconds of windows per view file segment (default 15 min).
+    pub view_segment_ms: i64,
+    /// Mapped sealed segments, or `pread`.
+    pub view_read: ViewRead,
+    #[doc(hidden)] pub cold_decode_delay_ms: u64,
+    #[doc(hidden)] pub unpersistable_views: Vec<PhysicalASAPNodeId>,
 }

 // data_plane/src/persist.rs
+pub const FORMAT_VERSION: u32 = 2;
+pub enum ViewRead { Mmap, Pread }
+/// One view's fragment of one window in a segment.
+pub struct WindowLocation { .. }
+impl WindowLocation {
+    pub fn read(&self, schema: &SchemaRef, how: ViewRead) -> Result<Batch, Error>;
+    pub fn segment_path(&self) -> &Path;
+    pub fn offset(&self) -> u64;
+    pub fn len(&self) -> u32;
+    pub fn is_sealed(&self) -> bool;
+    pub fn maps(&self, address: usize) -> bool;
+}
+pub type ViewIndex = BTreeMap<PhysicalASAPNodeId, Vec<((i64, i64), WindowLocation)>>;
 pub struct Written {
     pub bytes: u64,
     pub sync_ns: u64,
     pub not_persisted: u64,
+    pub locations: Vec<(PhysicalASAPNodeId, WindowLocation)>,
 }
 impl ViewFiles {
+    pub fn with_segment_ms(self, segment_ms: i64) -> Self;
+    pub fn seal(&mut self, group: usize) -> io::Result<()>;
+    pub fn delete_expired(&mut self, group: usize, oldest_kept_end_ms: i64) -> io::Result<usize>;
+    pub fn index(&mut self, groups: &[Vec<(MaterializedView, SchemaRef)>]) -> io::Result<ViewIndex>;
 }

 // data_plane/src/window_cache.rs (new)
+pub struct WindowKey { pub view: PhysicalASAPNodeId, pub end_ms: i64 }
+pub struct WindowCache { .. }
+impl WindowCache {
+    pub fn new(max_bytes: Option<u64>, idle: Option<Duration>) -> Self;
+    pub fn insert(&self, key: WindowKey, batches: Arc<Vec<Batch>>, bytes: u64, now: Instant);
+    pub fn get(&self, key: WindowKey, now: Instant) -> Option<Arc<Vec<Batch>>>;
+    pub fn get_or_load(&self, key: WindowKey, now: Instant, load: impl FnOnce() -> Result<(Arc<Vec<Batch>>, u64), Error>) -> Result<Arc<Vec<Batch>>, Error>;
+    pub fn evict_idle(&self, now: Instant);
+    pub fn set_target_bytes(&self, target: Option<u64>);
+    pub fn remove(&self, key: WindowKey);
+    pub fn stats(&self) -> CacheStats;
+}

 // data_plane/src/memory_budget.rs (new)
+pub struct CgroupMemory { pub max_bytes: Option<u64>, pub current_bytes: u64, pub anon_bytes: u64, pub file_bytes: u64 }
+pub fn read_cgroup(dir: &Path) -> io::Result<CgroupMemory>;
+pub fn default_view_cache_budget(cgroup: &CgroupMemory, other_pools_bytes: u64) -> Option<u64>;
+pub fn monitored_target(budget: Option<u64>, cgroup: &CgroupMemory, cached_bytes: u64) -> Option<u64>;

CLI: --view-cache-max-bytes, --view-cache-idle-ms, --view-segment-ms, --view-read mmap|pread.

Algorithm

  • Commit: the window is appended Pending and inserted into the cache; persist threads encode its columnar fragments and append the record to the group's active segment, then acknowledge the locations; the committer turns the window Stored.
  • Read: tiling windows are streamed lazily; a Stored window not in the cache is decoded once (single flight) from its fragment: borrowed from the mapping for sealed segments, pread for the active one; inserted if it fits.
  • Evict: CLOCK over cached Stored windows, by idle time and the byte budget; a 1 s monitor of memory.current/memory.stat lowers the target when anonymous memory runs high.

Tests (failing first)

Test Where Failed before the implementation because
V1 parity, every read cold (instant and range; run with PARITY_INGEST_THREADS=1,4,8) tests/planner_executor_parity.rs with_every_view_read_cold_* install refuses view_cache_max_bytes
V2 every state family reads back from its fragment (active, mapped, pread) src/persist.rs Written::locations is empty
V3 one view's fragment reads alone; a damaged one is an error src/persist.rs as V2
V4 idle entries leave, read ones stay src/window_cache.rs cache not implemented (panics)
V5 the byte budget holds; oversized windows not kept; lowered target src/window_cache.rs as V4
V6 concurrent cold reads decode once src/window_cache.rs as V4
V7 a window leaves memory only after it is written tests/view_tiering.rs install refuses the options
V8 windows that cannot be written stay in memory tests/view_tiering.rs as V7
V9 segments roll and expire; files bounded src/persist.rs, tests/view_tiering.rs seal/delete_expired not implemented; install refuses view_segment_ms
V10 a segment deleted during a read stays readable tests/view_tiering.rs as V7
V11 restart indexes without decoding tests/view_tiering.rs tiering metrics missing
V12 a torn segment tail is cut at restart src/persist.rs, tests/view_tiering.rs no segments, index not implemented
V13 old-format and other-plan files set aside src/persist.rs index not implemented
V14 cgroup budget and monitor src/memory_budget.rs not implemented
V15 no OOM under memory.max scripts/tiered_views_cgroup.sh + examples/tier_bench.rs manual run; the tiered arm is refused today
V16 concurrent commits, evictions and queries answer alike tests/view_tiering.rs as V7
V17 metrics tests/view_tiering.rs as V7
V18 mapped reads borrow fixed-width columns src/persist.rs as V2
V19 an unlinked sealed segment stays readable src/persist.rs as V2
B1/B2 examples/tier_bench.rs (VIEW_CACHE_MAX_BYTES, VIEW_READ, COLD=1) reported, not CI
B3 examples/view_read_bench.rs reported, not CI

Verification

See the test run in the PR comments: every new test fails for the reason above; the existing tests are unchanged.

Follow-ups

  • Planner cost model for "view on disk" (requirements list in the document; separate repo).
  • Hierarchical rollup levels make the cold tier nearly free on dashboards.

Push precompute (#854)

Merged into #855 (feat/tiered-view-storage, merge commit 1019cc9, head 0b0b46d). The demo runs from that one branch, with push precompute as the data_plane default (--precompute-mode window keeps the window path). The demo-workload A/B is in docs/design/parallel-precompute.md, "Demo workload A/B", on that branch.

Design: docs/design/parallel-precompute.md.

This PR has the design, the approved tests T1–T19 and B1–B2, and the push precompute implementation (--precompute-mode push). Push is now the data_plane default; --precompute-mode window keeps the window path.

For reviewers

  1. data_plane/src/push.rs: shard instances, the PushStore, the install probe, seal, and the memory budget.
  2. The committer changes in engine.rs: PrecomputeJob::Push, PoolEvent::Partial and WindowTasks::push_window reuse the pool's reorder buffer, merge and barriers.
  3. Test changes after approval. These fix test bugs or align a test with the merged task pool. No assertion was weakened.
    • T5: regroups by the first label column when a scan has no job column.
    • T7: collects the rules seen.
    • T13: seals the window behind a barrier before sending the late sample, and expects 4 late samples per metric an ingestion-time view reads.
    • T14: runs one precompute thread, because the pool's slots would otherwise hold more windows than the test writes.
    • T1: takes PARITY_PUSH_SHARDS.
  4. Still ignored.
    • T9: no plan with a view over a view.
    • T5's engine-level half: a hand-written Reduce chain does not compile.
    • T16: chunked seal is not implemented. Seal is one step per window. Out of scope for this PR, as is T9.

What push does

  • Which groups are pushed. A group whose run splits by series, carries no state across windows, reads no view, and whose Scans read exactly the window (checked by a probe at install) is built by push. Other groups stay on the window path.
  • Folding on the shards. Each ingest shard (series hash) keeps one instance of the group's compiled ingestion run per open window. The instance runs over a store whose raw-data slots are streams fed inline on the shard thread. Each morsel is converted once per metric and slot schema and reaches every view of its source, with no queue and no raw buffer.
  • Seal and commit. After the flush that closes a window, every shard seals it, idle shards with an empty run. The committer concatenates the partials, using the pool's series-split merge, and commits them through the same reorder buffer, persistence and barriers.
  • Memory budget. --precompute-memory-budget-bytes is checked against the instances' run memory. While an older window is open anywhere, state may go over the budget until its seal frees it. A lone window over the budget fails alone.
  • Metrics and rules.
    • Phases precompute_push, precompute_seal (by group and shard), precompute_combine and precompute_commit.
    • Gauges asap_precompute_state_bytes, asap_precompute_open_instances and asap_window_commit_lag_seconds.
    • asap_samples_total{outcome="late_for_views"}.
    • pipelines::combine_rule(s) implement the rule table.

Results

The design doc records E1/E2 in D1, D2, D8 and D9, and has a B1/B2 section.

B1/B2 (typical 60 s / 10 Hz dashboard, 12 views, raw data not kept, K ingest shards = K precompute threads, paced at 10 Hz). Push coalesces each shard's samples into morsels of up to 32,768 samples or 1 s before folding (--push-batch-samples, --push-batch-max-ms); a seal folds what is pending first.

series, K window ready, window path / push (mean s) M samples/s, window path / push fold CPU, window path / push (s) total CPU, window path / push (s)
10k, 4 18.5 / 12.3 0.20 / 0.20 (offered) 121 / 135 234 / 235
10k, 12 14.7 / 12.3 0.20 / 0.20 (offered) 126 / 140 254 / 259
100k, 4 (2M/s offered) 224 / 193 0.78 / 0.86 1,436 / 1,523 1,870 / 2,028
100k, 12 (2M/s offered) 88.6 / 44.7 1.33 / 1.59 1,422 / 1,312 1,926 / 1,693
  • Latency. Push commits each window at the 15 s lateness bound at 10k series, whatever K is. At 100k series and K = 12 it halves the window path's latency.
  • CPU, 10k series. Before batching, push used about 1.75× the window path's fold CPU when paced. With batching it uses 1.1×, and total CPU matches.
  • CPU, 100k series and K = 12. Push uses 8% less fold CPU and 12% less total CPU than the window path.
  • Default. Push is the data_plane default (--precompute-mode window keeps the window path).

Core scaling

Setup.

  • The engine host has 28 physical cores and 56 logical CPUs. The engine is pinned to CPUs 0..K: physical cores first, then SMT siblings.
  • Senders run on a second host over 10 GbE (iperf3: 9.42 Gbit/s, RTT 0.06 ms) and back off exponentially on 503.
  • Workload: the dashboard plan with 200k series. Throughput is measured at saturation over 145 s.
K push M samples/s (efficiency vs K = 12) window path M samples/s
4 0.89 (0.82) 0.46
12 3.25 (1.00) 0.21
16 4.41 (1.02) 0.17
28 physical 6.59 (0.87) 0.13
32 (+SMT) 6.56 (0.76) 0.12
48 (+SMT) 8.00 (0.62) 0.10
56 (+SMT) 8.59 (0.57) 0.09

Push.

  • Scaling. Close to linear up to the 28 physical cores. SMT siblings add about 30%.
  • The knee. It is the single ingest coordinator, not the fold or the committer. Its CPU grows with the request rate. Shard queues are counted out only when it applies a report, so Remote Write gets 503s while engine cores are still idle.
  • Request size. With larger requests (12 senders), push takes 8.69M samples/s at K = 28 with no 503.
  • Profile. Most engine CPU goes to Remote Write decode, with series interning the top symbol.
  • Latency. At 1M samples/s offered, push commits each window 16.8 s after its end at K = 12, 28 and 56 (15 s lateness + < 2 s).

Window path (with --precompute-threads K).

  • With 48 small-request senders it does not scale, and it cannot sustain even 1M samples/s.
  • Its coordinator is saturated. It drops and rebuilds raw pane maps, and the shards clone those maps on every append (copy-on-write).
  • With fewer, larger requests it reaches 0.51M samples/s at K = 28.

The full tables are in the design doc's B section.

Verification

  • cargo test -p data_plane: every test passes.
    • push_precompute: 15 passed, 3 ignored (T9 and T16 are out of scope for this PR).
    • precompute_pool, ingest_shards, planner_executor_parity (T1, T2) and the rest: all pass.
  • Parity of push against the Planner executor (T1) and of stored view rows (T2): pass at K = 1, 4, 8, 12 (PARITY_PUSH_SHARDS).
  • Window-path parity: passes at K = 1, 4, 8, 12 ingest shards and precompute threads.

Remote Write decode (#861)

Summary

Remote Write decode was the data plane's biggest CPU cost on the demo48 live workload (34,220 series at 10 Hz, 342k samples/s, 4 feeder shards): 55.6% of ASAP's phase CPU. This PR cuts it from 652 to 212 ns per sample in the server, and from 514 to 147 ns per sample in a single-thread benchmark on captured demo48 requests. Results do not change: the same samples, series and errors, checked against the old decoder.

Results

End to end. One data plane on 20 CPUs of a 40-core x86 server (2.2 GHz). It is fed by the four demo48 feeder shards at the demo rate and serves the demo's four query users. The table covers 20 minutes after a 2-minute warm-up. Old = 24342eab, new = this PR's changes on 24342eab. The decode path is the same on the current branch head.

old new
remote_write_decode CPU 0.223 cores (48.0% of phases) 0.073 cores (23.4%)
decode ns/sample 652 212
precompute 0.154 0.151
append 0.048 0.047
query 0.031 0.032
data plane process total 0.557 cores 0.393 cores (−29%)
samples/s accepted + unrouted 286,195 + 55,999 286,195 + 55,999
failed writes, answered queries 0, 7,023 0, 7,034

Saturation (data plane limited to 4 CPUs, feeder rate raised per series, 3 minutes measured per step):

per-series rate (samples/s offered) old new
30/s (1.03 M) sustained, decode 523 ns/sample, 1.01 cores sustained, decode 156 ns/sample, 0.63 cores
45/s (1.47 M) 503s (queue full) 503s (queue full)

The ceiling did not move. At it, the process uses under 1 of its 4 CPUs in both builds, so the limit is not decode CPU. It is a serial stage behind the ingest queue, and decode no longer competes with it for CPU. That bottleneck is outside this PR.

Benchmark (rw_corpus_bench on 1,080 captured demo48 bodies: 20.5 M samples, 2.37 GB decompressed, about 115 bytes per sample, one sample per TimeSeries; one thread with a warm cache):

ns/sample old new
snappy 111 40
protobuf walk ≈335 ≈71
series lookup ≈68 ≈36
decode total 514 147
hand-off to 4 shards 30 9.5
8 threads, decode + hand-off CPU 591 163

The snappy figures are measured on their own. The walk and lookup figures split the rest of the decode by their perf shares.

What changed, and what each step gave (decode ns/sample, benchmark)

  1. 514 → 210. Reuse a per-thread decompression buffer. A fresh zeroed allocation per request cost about 70 of the 111 ns in snappy (zeroing plus page faults). Inline the protobuf reader, with a fast path for one-byte varints. Before this, Reader::field/varint/take were out-of-line calls and took half the decode time.
  2. 210 → 188. Skip a series' leading labels by their one-byte tag and short length. Walk only the fields outside the labels when collecting samples. Read the timestamp varint of the sender's sample layout inline.
  3. 188 → 165, hand-off 28 → 12.5. Series are never forgotten, so the interner now returns &'static Series instead of Arc<Series>. RawSample.labels, Chunk.series, intern* and by_identity change type. No reference count is written per sample anywhere (decode, routing, chunk building, drop). Before, that count was written from the decode thread and from the ingest threads.
  4. 165 → 151. The per-thread series cache remembers which series came next last time. A lookup first compares the key with that prediction. Senders keep their order, so a hit costs one memcmp and no hash. Every hit is still a byte-for-byte match.
  5. Hand-off 12.8 → 9.5. try_ingest sizes each shard's vector for its share up front.

Tried and dropped: other snappy decoders, measured on the same bodies. snap 1.1.2 runs at 2.9 GB/s, the C++ library (snappy_src) at 1.5 GB/s, and the S2 decoder (minlz) at 1.5 GB/s, so snap stays. Decoding straight into per-shard vectors was not tried: after step 5 the hand-off costs 9.5 ns.

Tests

  • New tests/remote_write_reference.rs keeps the old decoder verbatim and checks that decode_samples gives the same series ids, timestamps, value bits (stale markers included) and errors on:
    • 300 generated requests: labels in sorted, reversed and shuffled order; labels interleaved with samples or after them; series appearing mid-stream; 0 to 3 samples per series; unknown fields; label lengths of one, two and three bytes.
    • Invalid series: no __name__, a duplicate label, a label that is not UTF-8, sample limits from 0 to 5.
    • Every truncation and 12,000 byte flips of encoded requests, plus truncated and corrupted snappy bodies.
    • The 1,080 captured demo48 bodies, with RW_CORPUS_DIR set (all 20.5 M samples match).
  • A mutation check: breaking the label fast path makes three of the four tests fail.
  • cargo fmt --check and cargo clippy -p data_plane --tests --examples are clean.
  • Release-mode results:
    • pass: --lib filtered to remote_write, store, series_ids, engine, ingestion and push; --test series_ids, server, remote_write_reference, no_forward, concurrency, push_precompute (3 of 3 runs), range_isolation, planner_executor_answers.
    • fail on the base too: ingest_shards::a_shard_running_ahead_does_not_close_windows_early is timing-dependent. It failed 2 of 3 runs on the base and fails here as well.
  • T15 fix (push_precompute::memory_reservations_wait_then_fail_only_a_lone_window). The test posted the small window's and the large window's requests back to back. It relied on the small window being sealed before the large window's samples were folded. With the faster decode they arrive while the small window is still open, so the large window's reservation waits (as designed) and nothing fails. Adding a 2 ms sleep per request makes it pass again, which confirms the cause. The test now seals the small window with a barrier at 10 s before posting the large one, and it passes on both the base and this branch.

Usage

## Decode cost on captured bodies (one file per request body):
cargo run --release -p data_plane --example rw_corpus_bench -- DIR [ROUNDS] [THREADS] [SHARDS]
## Compare the decoder with the reference on them:
RW_CORPUS_DIR=DIR cargo test --release -p data_plane --test remote_write_reference

…ote Write decode

The content of feat/tiered-view-storage (with #852's review fixes merged
at 18b080bf), on top of main.
@zzylol zzylol added enhancement New feature or request area: data plane Runtime ingestion, storage, and query-serving data paths labels Nov 24, 2026
… window-path group's close

The late cutoff of a metric was the oldest window still open among the
window-path groups only, so with a pushed long group and a window-path
short group on one metric, the short group's close dropped samples the
long group's open window still needed. A metric any push group scans is
no longer dropped as late by the router; push shards drop the samples of
their sealed windows themselves. Raw-data eviction still counts only
window-path groups.
… groups

The budget failed a window only when a shard had exactly one instance
open, so with two or more push groups it never applied. A shard now
fails its largest open window when no group has an older window open on
any shard. The EngineOptions doc says what is enforced: nothing waits.
…a declared stream start

Without a declared stream start the first window is skipped though it
had data, and after a restart that loaded views the samples before it
are gone, so a range reaching back before a view's first stored window
is missing data, not empty. The floor now applies only with the stream
start declared, and ViewStore::restarted clears it as
Ingestion::restarted does.
…a fragment encodes

append_record created (and truncated) the segment file before any
fragment encoded, so a window recomputed after a restart whose end
equals a recovered segment's first end truncated that (maybe mapped)
segment. A segment is now created only when a record has a fragment,
with create_new; when its name is taken it goes to <end>_<n>.seg, which
the index reads by the part before the underscore.
A fragment's offset plus length is added with checked_add; at index time
a record whose head names a texts, grids or fragment range outside its
own frame ends the segment, as an undecodable record does; and a
fragment's row count is bounded by its length before a constant column
allocates it.
A window removed (past retention) while its decode was in flight was
inserted when the decode finished, and a removed key stayed in the CLOCK
ring. remove now marks an in-flight key so the loader does not insert it,
and takes the key out of the ring.
… the probe's seal

The install probe counted the Scans opened before the run's first stall;
a Scan opened only after the seal would get no samples on the shards.
Such a group now stays on the window path.
The data plane decides which groups are pushed by its install probe
(push::probe); pipelines.rs was read only by the push tests. It moves to
tests/pipelines/, and the comments no longer say install uses it.
Segments directly in a group's directory, before the split by retention,
were only ever written by this branch's earlier revisions.
…:Text

Plain and text values are columns of a fragment; only states are stored
as a StoredValue.
One value formatter for instant and range answers; format_value stays
as the test reference write_value is checked against. Envelope is kept:
VectorResponse and the matrix reference test both use it.
…ap::ValueEnum

An unknown value is now an error instead of silently meaning window or
mmap; ingest_bench parses PRECOMPUTE_MODE strictly too. The library
default stays Window, and its doc says why it differs from the binary's
push.
WindowLocation::{offset,maps,is_cold,is_sealed} are cfg(test);
Snapshot::view_rows, ViewStore::rows and ViewRowsByView are doc(hidden);
DEFAULT_VIEW_SEGMENT_MS re-exported persist's default and is inlined.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: data plane Runtime ingestion, storage, and query-serving data paths enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant