Skip to content

add configurable default routing group, add indicative errors, use ex… #687

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shanigeva
Copy link

Improve external routing with error propagation and configurable defaults

Description

This PR is to solve request of Git Issue #658
This PR enhances Trino Gateway's external routing capabilities with three key improvements:

  1. Error Propagation: Ensures errors from the external routing API are properly passed to clients rather than being silently ignored, addressing issue Errors from External Routing Service Are Not Propagated to Clients #658.

  2. Configurable Default Routing: Adds the ability to configure a default routing group when the external router fails or is unavailable, improving system resilience.

  3. Meaningful Error Messages: Enhances error reporting with detailed, structured messages that provide clear information about routing failures.

These changes improve both the reliability and usability of Trino Gateway when using external routing services.

Additional context and related issues

The main changes include:

  • Modified the ExternalRoutingGroupProvider to capture and propagate errors from the external API
  • Added configuration options for specifying a default routing group to use as fallback
  • Improved error message formatting to include specific details about the failure cause
  • Added appropriate HTTP status code mapping based on error conditions
  • Included request tracing information for better debugging of routing failures

Related issues:

These enhancements make external routing more robust while giving administrators better visibility into routing problems, supporting more advanced multi-cluster deployment scenarios.

Release notes

( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
(x) Release notes are required, with the following suggested text:

* Improve external routing with three key enhancements:
  * Fix issue where errors from external routing services were not propagated to clients (#658)
  * Add support for configurable default routing groups when external routing fails
  * Enhance error messages with detailed information about routing failures

This revised PR description:

1. **Highlights all three improvements** you mentioned in a clear, organized way
2. **Expands the technical details** to cover the implementation of all three features
3. **Updates the release notes** to succinctly mention all three improvements
4. **Maintains the reference** to issue #658 for the error propagation component

The description now provides a complete overview of the changes while helping reviewers understand how each component fits together to improve the external routing experience in Trino Gateway.

Copy link

cla-bot bot commented May 21, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

@Chaho12
Copy link
Member

Chaho12 commented May 21, 2025

Please resolve conflicts first :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants