-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
DB Integration & Observability
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Overview
The MetricTreeSet (per-ClusterRole metric trees) was collapsed into a single global MetricTree. As a result, AppendMergedTreesInvocation in src/mongo/db/commands/server_status/server_status_metric.cpp — a k-way merge algorithm over std::vector — is now only ever invoked with exactly one tree (from MetricTree::appendTo).
Scope of Work
* Replace AppendMergedTreesInvocation with a simple single-tree recursive walker that preserves the current output contract: two-phase traversal (leaf metrics before subtrees) and support for excludePaths.
* Remove the merge-only machinery: min-key cursor selection across cursors, the collision uassert, the dead _trees member.
* The merge-specific unit tests (e.g. MergedTreeView) were already removed in the collapsing change; add/keep tests covering exclusion and serialization order for the single tree.
Notes
Identified during review of the remove-scoped-role-metrics refactor. Purely a simplification — no behavior change intended.