-
-
Notifications
You must be signed in to change notification settings - Fork 8
feat: Support configuring the external endpoint of Trino clusters for ackUri rewriting #100
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
base: main
Are you sure you want to change the base?
Changes from all commits
0f67ea2
d17d00e
f72c9ad
ec1c67a
7c17b4e
26e2840
e761bb1
2615b9c
5557722
cfc1ede
ee5a8d4
875fb24
f40cabd
e9b150b
54b235d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,6 +52,10 @@ pub struct TrinoQuery { | |
| /// Endpoint of the Trino cluster the query is running on. | ||
| pub trino_endpoint: Url, | ||
|
|
||
| /// (Optionally, if configured) public endpoint of the Trino cluster. | ||
| /// This can e.g. be used to change segment ackUris to. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: Change to... what? I feel like this sentence needs to better communicate what actually gets updated/changed. |
||
| pub trino_external_endpoint: Option<Url>, | ||
|
|
||
| /// The time the query was submitted to trino-lb. | ||
| pub creation_time: SystemTime, | ||
|
|
||
|
|
@@ -80,13 +84,15 @@ impl TrinoQuery { | |
| trino_cluster: TrinoClusterName, | ||
| trino_query_id: TrinoQueryId, | ||
| trino_endpoint: Url, | ||
| trino_external_endpoint: Option<Url>, | ||
| creation_time: SystemTime, | ||
| delivered_time: SystemTime, | ||
| ) -> Self { | ||
| TrinoQuery { | ||
| id: trino_query_id, | ||
| trino_cluster, | ||
| trino_endpoint, | ||
| trino_external_endpoint, | ||
| creation_time, | ||
| delivered_time, | ||
| } | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # Postgres sqlx stuff | ||
|
|
||
| First start a postgres: | ||
|
|
||
| ```bash | ||
| docker run --rm -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=admin postgres | ||
| ``` | ||
|
|
||
| Afterwards you set the `DATABASE_URL` env var and prepare stuff for offline compilation: | ||
|
|
||
| ```bash | ||
| export DATABASE_URL=postgres://postgres:postgres@localhost/postgres | ||
|
|
||
| cd trino-lb-persistence | ||
|
|
||
| cargo sqlx migrate run --source src/postgres/migrations | ||
| cargo sqlx prepare --workspace | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| ALTER TABLE queries | ||
| -- nullable, as it's Option<&str> | ||
| ADD trino_external_endpoint VARCHAR; |
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.
suggestion: Slight reword. The fact that this option is optional implies that it only takes effect when configured.
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.
I prefer my variant as it makes it a bit more clear.
Every Trino always has a public endpoint. The question is, if trino-lb was configured to know about it or not