Fix #1048 (follow-up): nullable other_process_cpu in config.ensure_collection_table#1052
Merged
Merged
Conversation
… config.ensure_collection_table The #1048 Linux host-CPU fix made collect.cpu_utilization_stats.other_process_cpu_utilization nullable in install/02 and added the upgrade-folder ALTER, but config.ensure_collection_table (the on-demand "recreate a missing collection table" proc in install/06) still declared the column NOT NULL. If that proc ever recreates the table, the Linux collector's NULL insert would fail again — re-introducing #1048 on the recreate path. Aligns the proc's CREATE block with install/02 + upgrade 02. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
config.ensure_collection_table(install/06) — the proc that recreates a collection table on demand if it's missing — still declaredcollect.cpu_utilization_stats.other_process_cpu_utilizationasNOT NULL, even though the #1048 Linux host-CPU fix (#1049) made that column nullable everywhere else (install/02 CREATE TABLE + the 2.11.0→2.12.0 upgrade ALTER).If that proc ever recreates the table, the Linux collector's
NULLinsert (host CPU isn't derivable on Linux) would fail again — silently re-introducing #1048 on the recreate path.Change
One line in
install/06_ensure_collection_table.sql:NOT NULL→NULLonother_process_cpu_utilization, matching install/02 and upgrade 02. The persisted computedtotal_cpu_utilizationalready tolerates a NULL base column (NULL propagates).Context
Caught during 2.12.0 release prep (which was subsequently shelved); salvaged as a standalone fix since it's an independent completion of #1048, unrelated to the shelved work.
🤖 Generated with Claude Code