Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(connector): SQL Server sink connection redirect support #17848

Closed
wants to merge 1 commit into from
Closed

feat(connector): SQL Server sink connection redirect support #17848

wants to merge 1 commit into from

Conversation

chrisolszewski
Copy link

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.

  • The main change is the introduction of a connect_with_redirect method in SqlClient that handles the initial connection attempt and potential redirect.
  • If a redirect is required (indicated by Error::Routing), it creates a new configuration with the updated host and port and attempts to connect to the new address.
  • Error handling has been improved to provide more context about where the connection failed.

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

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added test labels as necessary. See details.
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

Connectors

Improve SQL Server sink connector to handle redirects, enhancing compatibility with Azure SQL firewall settings.

@chrisolszewski
Copy link
Author

This functionality appears to be included in #17429 along with other changes. Closing this

@chrisolszewski chrisolszewski deleted the azure-sql-sink-redirect branch July 29, 2024 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant