mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-03 04:38:48 +00:00
Metric identity lived in idx_metrics_lookup, ordered (type, id, metric, tier, timestamp). Once a series retains history, that order gives every series its own insertion point, so each poll's commit rewrites one index leaf page per series through the WAL and again at checkpoint. On a three-node homelab running v6.4.5-rc.2 that came to 330-607 KB/s of disk writes, about 10.6 KB per ~60-byte sample and 27-50 GB a day (#1966). idx_metrics_query_all already holds the same five columns time-major, so one poll's samples for a resource share pages. It now carries uniqueness and serves every read, and the metric-major lookup index is dropped. With an hour of retained history for 480 series, 30 polls write 6,022 WAL frames instead of 25,310 (4.2x fewer); the empty-table issue-1124 estate drops from 36,308 frames to 20,223, and its ceiling tightens from 40,000 to 23,000. The tier-reconciliation overlap probe now names the identity index too; left to the planner it seeks on (tier, timestamp) alone once the metric-major tree is gone, which TestRetainedQueryPlansUseIndexes caught. Metric-filtered reads now scan a resource's other metrics in the window: a single-metric 500-node query went from 45 to 59 us and the 24-hour 50-disk smart_temp batch from about 0.25 to 0.49 s. All-metric dashboard reads are unchanged. Continuous write volume is the user-visible harm, so the contract records that trade explicitly. The migration reuses the crash-safe swap: databases whose identity is already enforced by a unique index defer the rebuild to startup maintenance and swap in one transaction, and a database with no unique index migrates synchronously. Keeping the name idx_metrics_query_all means a downgrade rebuilds only the lookup index and leaves no orphan. Refs #1966 |
||
|---|---|---|
| .. | ||
| alert_metrics.go | ||
| alert_metrics_test.go | ||
| availability_history.go | ||
| availability_history_test.go | ||
| directory_owner_other.go | ||
| directory_owner_unix.go | ||
| docker_observation_contract.go | ||
| identity_index_test.go | ||
| issue1124_write_amplification_test.go | ||
| norace_test.go | ||
| race_test.go | ||
| store.go | ||
| store_additional_test.go | ||
| store_bench_test.go | ||
| store_docker_observation_contract_test.go | ||
| store_downsample_test.go | ||
| store_large_seed_test.go | ||
| store_loadtest_test.go | ||
| store_query_plan_test.go | ||
| store_series_coverage_test.go | ||
| store_slo_test.go | ||
| store_test.go | ||
| store_tier_coverage_test.go | ||
| store_write_backpressure_test.go | ||