feat(connector): SQL Server sink connection redirect support #17848
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.
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
This PR updates the SQL Server sink to handle redirects, which can occur with certain Azure firewall settings. We have witnesses these connection errors in the current implementation with our Azure SQL databases which are placed in failover groups. The changes are primarily in the
SqlClient::new
function.connect_with_redirect
method inSqlClient
that handles the initial connection attempt and potential redirect.Error::Routing
), it creates a new configuration with the updated host and port and attempts to connect to the new address.These changes make the SQL Server sink more resilient when dealing with Azure environments that might require redirects. It follows the pattern suggested in the Tiberius documentation (https://github.com/prisma/tiberius?tab=readme-ov-file#redirects).
Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
Connectors
Improve SQL Server sink connector to handle redirects, enhancing compatibility with Azure SQL firewall settings.