Pulse/pkg
rcourtman 2c8cb8435d Make the time-major metrics index the unique identity index
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
2026-09-24 08:45:38 +01:00
..
agents fix(agents): preserve explicit disk includes at ingestion 2026-09-09 11:35:51 +01:00
aicontracts Preserve canonical Patrol planning and outcome continuity 2026-09-07 17:24:25 +01:00
audit Harden audit signatures against boundary forgery 2026-08-12 05:05:11 +01:00
auth fix(auth): synchronise local admin permissions during setup 2026-09-10 06:52:38 +01:00
cloudauth fix(hosted): preserve direct handoff membership continuity 2026-03-26 23:40:02 +00:00
db fix(ai): preserve diagnostic evidence and proposal boundaries 2026-09-06 01:54:28 +01:00
discovery Bound discovery probe response bodies 2026-09-01 10:37:26 +01:00
diskinventory fix(unifiedresources): merge PVE and agent rows for the same RAID array volume 2026-08-28 06:20:10 +01:00
edition Block in-app self-update on the Pro binary to prevent silent downgrade 2026-07-08 10:02:04 +01:00
extensions Fix audit storage migration and viewer races 2026-07-24 10:33:57 +01:00
fsfilters fix(alerts): stabilize noisy lifecycle signals 2026-08-29 17:32:17 +01:00
licensing Let a provider-hosted platform buy and renew its own licence 2026-09-23 23:30:34 +01:00
metrics Make the time-major metrics index the unique identity index 2026-09-24 08:45:38 +01:00
pbs fix(pbs): reject incomplete alerting measurements 2026-09-05 18:04:21 +01:00
pmg Bound Proxmox API success responses 2026-08-31 21:20:30 +01:00
proxmox test(proxmox): verify pending update credential routing 2026-09-08 22:33:55 +01:00
pulsecli Enforce server-owned action approval authority 2026-07-11 19:49:17 +01:00
reporting fix(patrol): preserve refusals and expose measured summary evidence 2026-09-05 22:29:48 +01:00
securityutil Block IPv6 transition addresses in SSRF guards (GHSA-8f8r-p75h-jwq5) 2026-07-31 17:57:26 +01:00
server test(server): serialize the remaining startup watchdog log reads 2026-09-21 09:41:00 +01:00
tlsutil feat(monitoring): alert on certificate validity 2026-08-06 09:47:03 +01:00