Refactor routing logics and remove unused lookups#923
Open
oneonestar wants to merge 4 commits intotrinodb:mainfrom
Open
Refactor routing logics and remove unused lookups#923oneonestar wants to merge 4 commits intotrinodb:mainfrom
oneonestar wants to merge 4 commits intotrinodb:mainfrom
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Refactor the code to separate Query ID/Cookie-based routing from new query submission routing.
Remove the unnecessary
getExternalUrlForQueryIdandgetRoutingGroupForQueryIdmethods, along with their related DAOs and caches. TheexternalUrlandroutingGroupfields are stored for newly submitted queries as before.Additional context and related issues
getExternalUrlForQueryIdandgetRoutingGroupForQueryIdare only used when a Query ID exists. However, their results are never persisted back to the database. We only store query history for newly submitted queries:trino-gateway/gateway-ha/src/main/java/io/trino/gateway/proxyserver/ProxyRequestHandler.java
Lines 190 to 196 in 5bf67f3
For newly submitted queries,
externalUrlandroutingGroupare stored here, so this refactoring won't affect the existing behavoir:trino-gateway/gateway-ha/src/main/java/io/trino/gateway/ha/handler/RoutingTargetHandler.java
Lines 94 to 114 in 5bf67f3
Release notes
(x) This is not user-visible or is docs only, and no release notes are required.