Fix Device UUID alignment between ConfigDB and Sparkplug Instance_UUID#627
Merged
AlexGodbehere merged 17 commits intomainfrom Apr 9, 2026
Merged
Fix Device UUID alignment between ConfigDB and Sparkplug Instance_UUID#627AlexGodbehere merged 17 commits intomainfrom
AlexGodbehere merged 17 commits intomainfrom
Conversation
Documents the plan to fix the Instance_UUID regeneration bug on schema change, migrate existing devices via a ConfigDB SQL migration, and add a Helm pre-upgrade backup hook.
Contributor
Author
|
Testing on dev cluster in progress... Before
DuringAfter
NotesAlthough the upgrade seemed to change the UUID I'm getting intermittent connectivity issues with Grafana and devices dropping. Need to investigate logs on @amrc-benmorrow FYI. Update: |
amrc-benmorrow
previously approved these changes
Apr 8, 2026
Contributor
amrc-benmorrow
left a comment
There was a problem hiding this comment.
LGTM assuming it tests OK
The PVC must be a hook resource so it exists before the Job runs. No delete policy on the PVC so it persists across upgrades.
The backup PVC is now a regular chart resource so it persists across upgrades. The hook Job uses Helm lookup to skip gracefully if the PVC doesn't exist yet (first install or upgrade from old version).
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.



Summary
pg_dumpof the ConfigDB before everyhelm upgrade, stores timestamped backups in a PVC, keeps last 5. Aborts the upgrade if the backup fails. Configurable viaconfigdb.backup.*in values.yaml (default: enabled, 2Gi storage).Instance_UUIDfrom the origin map. Includes a pre-flight check for duplicate Instance_UUIDs that fails cleanly and allows retry after fixing. Also wires in the previously un-wired v12 migration.prepareModelForSaving()inOriginMapEditor.vuenow uses the device's ConfigDB object UUID as the top-levelInstance_UUIDinstead of generating a random UUID. This prevents Instance_UUID regeneration on schema change and ensures new devices are aligned from creation.Test Plan
helm templateand verify pre-upgrade-backup Job and PVC render correctlyhelm upgrade, verify a backup appears in theconfigdb-backupsPVCInstance_UUIDin ConfigDB config matches the device's object UUIDInstance_UUIDis unchanged