Skip to content

feat: metrics for the WAL backlog blind spots - #285

Merged
beinan merged 1 commit into
lance-format:mainfrom
beinan:feat/backlog-metrics
Sep 30, 2026
Merged

beinan merged 1 commit into
lance-format:mainfrom
beinan:feat/backlog-metrics

Conversation

@beinan

@beinan beinan commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

Problem

Today mai3_bigclimb_run6p5_77b_t0r1 sat at 17,254 pending WAL generations, every read answered 503 for ~5 hours, and no metric or log said so — a customer noticed first. The stats scanner was reusing a stale row (#281), no master had ever indexed the store (#282), and the read cap fired silently. 40+ more stores were in the same state.

Fix

One metric per blind spot:

metric kind meaning / alert
master_stores_pending_over_read_cap gauge stores whose reads the cap is refusing right now; alert when > 0
master_stores_pending_over_1k, master_wal_pending_generations_total, master_wal_pending_generations_max gauge fleet backlog shape, refreshed every stats scan
master_stats_pending_recounted_total counter version-unchanged shortcut found a pending count different from the row it would have reused (the #281 condition); warn! when growth > 256
rollout_reads_refused_pending_total{store} counter now labeled by store so the unreadable store is named
rollout_merge_index_built_on_demand_total counter a merge built the key BTree because no master had (the #282 condition)

Gauges come from a small Backlog::summarize over the scan snapshot.

Verification

backlog_summary_counts_stores_over_the_read_cap (17,254 / 1,200 / 3 → total 18,457, max 17,254, 1 over cap, 2 over 1k). Existing scanner recount tests and core read-cap/merge tests pass; clippy clean.

🤖 Generated with Claude Code

Today a store sat at 17k pending generations, answering 503 to every read
for five hours, and nothing said so: the only signal was a customer. Four
metrics close that gap, one per blind spot:

- master_stores_pending_over_read_cap (gauge): stores whose reads the cap
  is refusing right now; alert when > 0. Also
  master_stores_pending_over_1k, master_wal_pending_generations_total and
  _max, refreshed every stats scan.
- master_stats_pending_recounted_total (counter): the version-unchanged
  shortcut found a different pending count than the row it would have
  reused (the lance-format#281 condition); warns when the growth exceeds 256.
- rollout_reads_refused_pending_total now carries a `store` label, so the
  unreadable store is named, not just counted.
- rollout_merge_index_built_on_demand_total (counter): a merge had to build
  the key BTree itself because no master had (the lance-format#282 condition).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@beinan
beinan merged commit 70b2e83 into lance-format:main Sep 30, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant