You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Restore legacy failover login alternation by default - #5138
Restore the default of Switch.Microsoft.Data.SqlClient.UseLegacyFailoverAlternationOnLoginSqlErrors to true. This restores partner alternation when a login-phase SQL error is returned by a mirror/non-readable secondary. Explicit false retains the login-error guard introduced in #4140; existing terminal authentication-error and timeout stop conditions remain unchanged.
Add simulator coverage for default/explicit switch settings, pooling, synchronous/asynchronous opens, primary retries, and terminal authentication rejection. Add opt-in real-server BAG and database-mirroring theories to the existing ManualTests suite. The adjacent README records the historical regression evidence, topology limitations, and execution instructions; build and feature documentation are updated. No public API changes, new connection-string keywords, localization changes, or pipeline changes.
Lab provisioning lives separately in the dotnet/sqlclient-samples repository, under FailoverLab/, supplied by companion dotnet/sqlclient-samples#2. The lab provides Linux Basic AG and Windows database-mirroring setup and runners for these opt-in ManualTests. No separate failover project or executable historical-package comparison capability is included.
Suggested release note: Restore default Failover Partner alternation after login-phase SQL errors, fixing a 7.1 regression affecting database mirroring and the reported listenerless Basic AG deployment.
Tests added or updated
Public API changes documented (no public API changes)
Verified against customer repro (diagnostic BAG and genuine mirroring labs verified; exact customer WSFC topology not reproduced)
env -u SQLCLIENT_BAG_TESTS -u SQLCLIENT_MIRROR_TESTS dotnet test src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj --framework net10.0 --filter 'FullyQualifiedName~BasicAvailabilityGroupFailoverTest|FullyQualifiedName~DatabaseMirroringFailoverTest' --logger 'console;verbosity=minimal' --blame-hang-timeout 2m — built successfully; both theories skipped as intended without opt-in. This establishes gating, not failover coverage.
bash /home/paul/dev/sqlclient-samples/dev/automation/50263-failover-lab/FailoverLab/lab.sh test with SQLCLIENT_REPO_ROOT pointing to this branch and disposable lab credentials supplied through environment variables — passed 12/12 SQL Server 2019 Linux BAG cases on .NET 10. The lab was stopped afterward with data retained.
git diff --check — passed.
Earlier validation of the same fix/tests before migration: Windows switch/failover units passed 259/259 across net462/net8/net9/net10; real-server three-role-phase coverage passed 144/144 checks across Linux SQL 2019/2022/2025 BAGs and Windows SQL 2019 mirroring. After suite consolidation, native Windows/.NET 10 ManualTests mirroring passed 12/12 using a temporary local checkout that was removed afterward. These earlier results are not reruns of the current GitHub-main-based branch.
Full BuildAll, full ManualTests, and native Windows mirroring on the migrated branch have not been run. Both lab theories remain opt-in/interactive and are excluded from normal orchestrated test filters. The Windows container/RTM lab is diagnostic, not evidence of an exact supported customer deployment.
Guidelines
Please review the contribution guidelines before submitting a pull request:
Fixesdotnet#5029. Add simulator and opt-in BAG/mirroring regression coverage, with recorded lab evidence and execution instructions.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
An unconditional reference to a NET-only helper breaks net462 compilation, and reused pool state can cause later failover tests to fail despite correct driver behavior.
Restores legacy failover-partner alternation by default to address the login-error regression reported in #5029. Explicitly setting the compatibility switch to false preserves the guard introduced in #4140.
Changes:
Changes the switch default to true without changing terminal authentication-error or timeout handling.
Expands simulator coverage and adds opt-in Basic Availability Group and database-mirroring tests.
Documents lab setup, historical validation, topology limitations, and test execution.
Keep the net462 ManualTests build compatible with the modern-only UseManagedNetworking helper property.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The failover tests violate the mandatory focused-scenario rule by combining sync/async and success/rejection behaviors, requiring separate theories for those scenarios.
This theory uses flags to select Open versus OpenAsync and successful alternation versus rejection, contrary to the mandatory focused-scenario rule in .github/instructions/testing.instructions.md (Required Test Authoring Rules, item 8). Split these into separate sync/async success and rejection theories, keeping pooling and unset/true settings as inputs where the behavior is unchanged. Apply the same sync/async split to LoginFailed_WithUserProvidedPartner_ShouldNotAlternate at line 1145; its switch settings can remain theory inputs.
Address dotnet#5138 review feedback with unique simulator pool keys and separate sync/async success and rejection theories. Share setup and assertions while preserving all 18 input cases.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Human review is needed because the driver-wide failover/retry default change lacks native Windows validation, retains an unresolved unit-test failure, and has not been validated against the customer’s WSFC topology.
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
Hotfix 7.1.3PRs targeting main that should be backported to release/7.1 for 7.1.3.Hotfix 8.0.0PRs that must be backported to release/8.0Regression 💥Issues that are regressions introduced from earlier PRs.
3 participants
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.
Description
Restore the default of
Switch.Microsoft.Data.SqlClient.UseLegacyFailoverAlternationOnLoginSqlErrorstotrue. This restores partner alternation when a login-phase SQL error is returned by a mirror/non-readable secondary. Explicitfalseretains the login-error guard introduced in #4140; existing terminal authentication-error and timeout stop conditions remain unchanged.Add simulator coverage for default/explicit switch settings, pooling, synchronous/asynchronous opens, primary retries, and terminal authentication rejection. Add opt-in real-server BAG and database-mirroring theories to the existing ManualTests suite. The adjacent README records the historical regression evidence, topology limitations, and execution instructions; build and feature documentation are updated. No public API changes, new connection-string keywords, localization changes, or pipeline changes.
Lab provisioning lives separately in the dotnet/sqlclient-samples repository, under
FailoverLab/, supplied by companion dotnet/sqlclient-samples#2. The lab provides Linux Basic AG and Windows database-mirroring setup and runners for these opt-in ManualTests. No separate failover project or executable historical-package comparison capability is included.Suggested release note: Restore default Failover Partner alternation after login-phase SQL errors, fixing a 7.1 regression affecting database mirroring and the reported listenerless Basic AG deployment.
falseremains available)Issues
Fixes #5029.
Related investigation: ADO.Net work item 50263. Regression introduced by #4140.
Testing
Validation on this GitHub-main-based branch:
dotnet test src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj --framework net10.0 --filter 'FullyQualifiedName~ConnectionFailoverTests|FullyQualifiedName~LocalAppContextSwitchesTest' --logger 'console;verbosity=minimal' --blame-hang-timeout 2m— built successfully; 74 passed, 1 failed, 0 skipped (75 total). Remaining failure:TransientFault_IgnoreServerProvidedFailoverPartner_ShouldConnectToUserProvidedPartner.env -u SQLCLIENT_BAG_TESTS -u SQLCLIENT_MIRROR_TESTS dotnet test src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj --framework net10.0 --filter 'FullyQualifiedName~BasicAvailabilityGroupFailoverTest|FullyQualifiedName~DatabaseMirroringFailoverTest' --logger 'console;verbosity=minimal' --blame-hang-timeout 2m— built successfully; both theories skipped as intended without opt-in. This establishes gating, not failover coverage.bash /home/paul/dev/sqlclient-samples/dev/automation/50263-failover-lab/FailoverLab/lab.sh testwithSQLCLIENT_REPO_ROOTpointing to this branch and disposable lab credentials supplied through environment variables — passed 12/12 SQL Server 2019 Linux BAG cases on .NET 10. The lab was stopped afterward with data retained.git diff --check— passed.Earlier validation of the same fix/tests before migration: Windows switch/failover units passed 259/259 across net462/net8/net9/net10; real-server three-role-phase coverage passed 144/144 checks across Linux SQL 2019/2022/2025 BAGs and Windows SQL 2019 mirroring. After suite consolidation, native Windows/.NET 10 ManualTests mirroring passed 12/12 using a temporary local checkout that was removed afterward. These earlier results are not reruns of the current GitHub-main-based branch.
Full BuildAll, full ManualTests, and native Windows mirroring on the migrated branch have not been run. Both lab theories remain opt-in/interactive and are excluded from normal orchestrated test filters. The Windows container/RTM lab is diagnostic, not evidence of an exact supported customer deployment.
Guidelines
Please review the contribution guidelines before submitting a pull request: