[9.x] Detect broken connection after MSSQL upgrade #44121
Merged
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.
After upgrading our SQL Server cluster last week, which normally fails over gracefully and happens with zero-downtime, we experienced the following error in a few of our pods until manually restarting them:
Apparently, when applying a patch to SQL Server, it will go in script upgrade mode during the recovery phase while restarting to patch system objects (like system tables and views). The time this takes depends on the patch and what objects it needs to update. Most times it will take like a minute or two. More details can be found in this blog post.
Since this is a very rare issue and hard & time consuming to reproduce, and because restarting our containers to force a reconnect to SQL Server helped, I assume this can be seen as an error indicating a broken connection. The SQL Server Management Studio (a Windows GUI) actually detects this error as a failed attempt to connect (as can be seen in this screenshot).