Fix SQL schema/job/validation defects from Fable code review (chunk 7)#1108
Merged
Conversation
- 01 fresh-install seed of config.ignored_wait_types was missing TRANSACTION_MUTEX, so fresh 2.12.0 installs collect it and can resurface the ANOMALY_WAIT_ TRANSACTION_MUTEX noise the 2.11->2.12 upgrade shipped to kill (install/03's seed has it but only fires when the table is empty, which never happens after 01 seeds it first). Added it alphabetically. - 45 agent-job recreation used sp_delete_job without @delete_unused_schedule = 1 (defaults to 0), so each reinstall/upgrade orphaned the job's schedule in msdb.sysschedules and created a fresh one — 3 orphans per upgrade, forever. Added @delete_unused_schedule = 1 to all three (00_uninstall already does this). - 98 validation remediation messages pointed at install/34a_hung_job_monitor.sql, install/35_create_agent_jobs.sql, and install/98_test_hung_monitor.sql — none exist. Corrected to 44_hung_job_monitor.sql / 45_create_agent_jobs.sql / 97_test_procedures.sql. Changes are syntactically trivial (a VALUES-list entry, a standard sp_delete_job parameter already used in 00_uninstall, and PRINT text). Full install needs your version testing across 2016-2025. Remaining schema/upgrade findings flagged for follow-up (deeper/riskier): 03 ensure_config_tables self-heal creates stale/divergent schemas (collection_schedule missing collect_query/collect_plan; installation_history wrong shape) on a live recovery path; 41 apply_collection_preset re-enables platform-incompatible collectors on MI/RDS; upgrades 2.1.0-to-2.2.0 compress-migration batch-scoped RETURN + PRINT-not-THROW; upgrades README example teaches the fresh-install-bug pattern; 01 misplaced ELSE in the blocked-process-threshold messaging. 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.
SQL schema/job/validation fixes from the Fable code review (chunk 7 of 7, final). Minimal, verifiably-correct changes; full install needs your version testing across 2016–2025.
Fixes
[HIGH] Fresh installs missing TRANSACTION_MUTEX in the ignored-wait seed —
install/01config.ignored_wait_typesis seeded by 01 first (non-empty), and install/03's seed (which does include TRANSACTION_MUTEX) only fires when the table is empty — so it never runs on a fresh install. Net: fresh 2.12.0 installs collect TRANSACTION_MUTEX and can resurface the exactANOMALY_WAIT_TRANSACTION_MUTEXnoise the 2.11→2.12 upgrade shipped to kill. Added it alphabetically to 01's seed.[MEDIUM] Agent-job recreation orphans msdb schedules —
install/45The three
sp_delete_jobcalls omitted@delete_unused_schedule = 1(defaults to 0), so each reinstall/upgrade left the job's schedule orphaned inmsdb.sysschedulesand created a fresh one — 3 orphans per upgrade, forever. Added the parameter to all three (00_uninstall.sqlalready does this).[LOW] Validation points users at non-existent files —
install/98Remediation messages referenced
34a_hung_job_monitor.sql/35_create_agent_jobs.sql/98_test_hung_monitor.sql— none exist. Corrected to44_hung_job_monitor.sql/45_create_agent_jobs.sql/97_test_procedures.sql.Remaining schema/upgrade findings — flagged for follow-up (deeper/riskier)
ensure_config_tablesself-heal creates stale/divergent schemas on a live recovery path (the master collector calls it every cycle):collection_schedulewithoutcollect_query/collect_plan(breaks collectors 08/09/10), and aninstallation_historyof an entirely different shape (breaks version detection).apply_collection_presetblanket re-enables every collector, re-enabling the ones 04 deliberately disabled as platform-incompatible on Azure MI / AWS RDS → a permanent ERROR stream.RETURNbeforeGOis a no-op, so a re-run double-compresses LOBs and can strandcollect.query_statsempty; the CATCH only PRINTs (no THROW), so the installer logs SUCCESS.These touch the live self-heal / upgrade paths and warrant your review + real version testing, so I left them rather than guess.
🤖 Generated with Claude Code