Repository navigation
Read the metrics keys of system.all_metric_log by name - #127195
Conversation
|
Workflow [PR], commit [c229920] Summary: ✅
AI ReviewSummaryThe PR changes the Missing context / blind spots
Findings❌ Blockers
Tests
Final VerdictStatus: ❌ Block. Preserve metric names through the inner remote merge and cover the combined mode with the focused regression above. |
| ordinary_columns.modify("metrics", [](ColumnDescription & column) | ||
| { | ||
| const auto & map_type = typeid_cast<const DataTypeMap &>(*column.type); | ||
| column.type = std::make_shared<DataTypeMap>( | ||
| std::make_shared<DataTypeLowCardinality>(std::make_shared<DataTypeString>()), map_type.getValueType()); |
There was a problem hiding this comment.
❌ [P1] Preserve metric names before the remote merge unifies schemas
This changes the schema of the outer union table, but when both create_union_system_log_tables.cluster and merge_rotated_tables are enabled, its source is still clusterAllReplicas(..., merge('system', '^metric_log(_[0-9]+)?$')). That inner merge infers its schema independently; it does not receive these explicit columns.
For a live bucketed table plus a rotated table with different enum numbering, TableFunctionMerge::getActualTableStructure calls StorageMerge::getColumnsDescriptionFromSourceTables, whose getLeastSupertypeOrVariant produces Map(Int16, Int64) for the differing enum-keyed maps (getLeastSupertype treats enums as signed integers). Each child's keys therefore become integers before the outer conversion runs. The new string-keyed schema then turns those integers into strings: the row inserted by the new test is returned with keys '1' and '2', rather than CurrentMetric_Query and ProfileEvent_Query. The upgrade bug remains in this supported mode.
Please ensure the inner remote merge converts each source's keys by name before schema unification. Extend the regression to the existing cluster-plus-merge node (node1), explicitly using the bucketed schema and the same rotated-table fixture; node3 exercises only the local path, which bypasses inference because it receives the explicit schema.
There was a problem hiding this comment.
Fixed separately in #127583, which makes merge keep enum names: a combined enum when the tables number it consistently, LowCardinality(String) when the numbering conflicts.
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes3 object files changed (+47.61 KiB total), 0 added.
719 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units7 translation units recompiled, 27 s compile time in total, 7 of them have a recent master baseline. |
6a36363
Backport #127195 to 26.10: Read the `metrics` keys of `system.all_metric_log` by name
Related: #112670
Related: #124016
The keys of
metricsin thebucketedsystem.metric_logare anEnum16numbered by the position of a metric, so most releases renumber them.system.all_metric_logcasts the rotatedmetric_log_Ntables to the current enum, which either fails withCANNOT_CONVERT_TYPEor silently shows the values under wrong metric names. Itsmetricsnow hasLowCardinality(String)keys, which are cast by name.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix reading
metricsfromsystem.all_metric_logwith thebucketedschema ofsystem.metric_logafter an upgrade: it failed withCANNOT_CONVERT_TYPEor showed the values of older rows under wrong metric names.Workflow [PR]
Sync PR [sync-upstream/pr/127195]
Version info
26.11.1.667-master(included in26.11and later)26.10.4.205