Repository navigation
fix: avoid duplicate table creation during upgrades - #454
Merged
Merged
Conversation
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
|
TheWitness
approved these changes
Nov 16, 2026
TheWitness
added a commit
that referenced
this pull request
Nov 16, 2026
…eate memo The memo added in #454 returned early for any previously successful db_update_table() call, so an owner column narrowed after the first check was never widened in the same process and the database regression test failed on every PHP version. Remember creations only. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
TheWitness
added a commit
that referenced
this pull request
Nov 16, 2026
…#453) (#455) * fix: resolve legacy hostField and collector status query failures (#451, #452, #453) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: keep detecting schema drift on existing tables after the #454 create memo The memo added in #454 returned early for any previously successful db_update_table() call, so an owner column narrowed after the first check was never widened in the same process and the database regression test failed on every PHP version. Remember creations only. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * test: cover repeated updates of an existing table in syslog_db_update_table() Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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.



Ref #440.
An upgrade can create dashboard tables and then try to create them again in the same request. Cacti retains the earlier negative table-existence result. Skip an identical schema operation that already succeeded for the same connection, and let install/upgrade callers create the tables before seeding the dashboard. Failed operations remain retryable; changed definitions and missing tables still run.
This covers the adjacent connect-then-upgrade path as well as repeated dashboard seeding, while retaining the older-Cacti primary-key compatibility fix from #439.
Verified with real Cacti schema helpers on MariaDB 11.8: two schema passes and two seed calls issue two CREATEs total, without errors, and leave one dashboard and five panels. PHP 8.2 Linux: 659 tests passed, one permission-dependent skip, one existing /proc probe warning. PHP syntax, manifest and translation checks pass. The current coverage filter does not measure these entrypoints. Static analysis has existing/environment diagnostics; no diagnostic lands on a changed line. The repository-requested graphify command is unavailable locally.