-
Notifications
You must be signed in to change notification settings - Fork 46
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
Replace Dropwizard with Airlift #317
base: main
Are you sure you want to change the base?
Conversation
gateway-ha/etc/config.properties
Outdated
node.id=ffffffff-ffff-ffff-ffff-ffffffffffff | ||
node.environment=test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The gateway is not clustered, why does it need a node.id
and node.environment
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's because HttpServerModule depends on NodeInfo which needs NodeConfig which requires non-null node.environment and node.id.
I should be able to set these in Java and eliminate these from the config file.
Might need to dig deeper to see if there are drawbacks of doing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no harm in having these value though .. right?
349c6e1
to
4c3f20a
Compare
gateway-ha/src/main/java/io/trino/gateway/ha/config/HaGatewayConfiguration.java
Outdated
Show resolved
Hide resolved
ab38025
to
d2a698e
Compare
I assume this is ready for PR right? |
@@ -32,6 +26,3 @@ modules: | |||
managedApps: | |||
- io.trino.gateway.ha.GatewayManagedApp | |||
- io.trino.gateway.ha.clustermonitor.ActiveClusterMonitor | |||
|
|||
logging: | |||
type: external |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update installation doc too?
https://github.com/trinodb/trino-gateway/blob/main/docs/installation.md?plain=1#L103-L112
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question. How is this different to httpConfig properties that you can set with https://trino.io/docs/current/admin/properties-logging.html properties using -Dconfig=var/config.properties
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
httpConfig
works the same as setting -Dconfig
. There was a discussion on Slack about the pros and cons of moving from YAML to properties, mixing YAML and properties, and keeping everything in YAML. We agreed to keep everything in YAML for now.
Since we chose to use httpConfig
, -Dconfig
won't work. They are mutually exclusive: https://github.com/airlift/airlift/blob/538e1ff498bca145c5ec4d582692367694a94fc8/bootstrap/src/main/java/io/airlift/bootstrap/Bootstrap.java#L151-L156
Yes. the all-or-nothing changes are done in this PR. Reviews are welcome. |
e1a0234
to
1d6fab8
Compare
d0b235d
to
ca2e9c4
Compare
ca2e9c4
to
ca04a23
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks ready to me, mod the discussion on the UI path. Awesome work, this is massive!
@Override | ||
public void log(Request request, Response response) | ||
{ | ||
// Logging without filter as both request and response don't contain sensitive information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should document this change for migration, as its used for debugging. I think the information is redundant with that in QueryIdCachingProxyHandler.logRewrite
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
import static jakarta.ws.rs.core.Response.Status.NOT_FOUND; | ||
|
||
@Path("/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will prevent forwarding /
to a backend correct? In some cases I forward /
, and access the TGW UI on the app port. IMO we should put all the UI assets behind a prefix such as /tgw
, and make the prefix configurable if possible
Description
Resolve #41
Commits cannot be built and tested individually. This is caused by the mass dependency conflict between Dropwizard and Airlift. It is impossible to replace Dropwizard part by part and keep each commit buildable. Also, it will be very difficult to review if all changes are squashed into one commit.
TODO in this PR
Follow-up later in other PRs
How to run in Intellij
VM options:
-Xmx1g -Djdk.attach.allowAttachSelf=true
Main class:
io.trino.gateway.ha.HaGatewayLauncher
Argument:
docs/quickstart-config.yaml
Working directory:
$ProjectFileDir$
Release notes
(x) Release notes are required, with the following suggested text: