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: Add support for Trino 470 #705

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

feat: Add support for Trino 470 #705

wants to merge 21 commits into from

Conversation

NickLarsenNZ
Copy link
Member

@NickLarsenNZ NickLarsenNZ commented Feb 5, 2025

Description

Part of stackabletech/docker-images#999.

Caution

Blocked by stackabletech/operator-rs#959.

Definition of Done Checklist

  • Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant
  • Please make sure all these things are done and tick the boxes

Author

Preview Give feedback

Reviewer

Preview Give feedback

Acceptance

Preview Give feedback

Copy link
Member

@sbernauer sbernauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation LGTM, many thanks!

It would be great if you could please add some docs for the user. Maybe below https://docs.stackable.tech/home/stable/trino/#_supported_versions? Or put it somewhere else and link to it there.
IMHO it should contain a quick explanation that Trino switches it's S3 implementation and link to trinodb/trino#24878.
Also mention that users can roll back to the legacy using this and that configOverrides, however that it will be removed eventually.

Thanks!

CHANGELOG.md Outdated Show resolved Hide resolved
rust/operator-binary/src/catalog/commons.rs Outdated Show resolved Hide resolved
rust/operator-binary/src/catalog/commons.rs Outdated Show resolved Hide resolved
@@ -70,6 +73,7 @@ pub trait ToCatalogConfig {
catalog_name: &str,
catalog_namespace: Option<String>,
client: &Client,
trino_version: u16,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In all operators (and all other places in this operator AFAIK) we call it product_version of type &str. For consistency reasons it would be great to have that here as well.
However, as Trino is special I like the u16, so mixed feelings here ^^
If we go with u16, we should do it in all places in the operator I'd say.

Just FYI that Starburst versions Trino with a trailing e (I guess enterprise), e.g. 467-e. If we want to support that in the future (there have been ideas), a &str would be more robust.
TLDR: I let you decide, but please make it consistent within trino-op

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just FYI that Starburst versions Trino with a trailing e (I guess enterprise), e.g. 467-e.

ROFL, I had done a semver impl just in case, then decided against it since I didn't see any current use cases 🤦.

See 9a695e32394339569b78b1a75ae8c86750d39ecc..72a55733928e79fe5c3dcfde99b6903fc2feb7aa#diff-44935ae74c

Will respond separately to the first paragraph.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In all operators (and all other places in this operator AFAIK) we call it product_version of type &str. For consistency reasons it would be great to have that here as well.
However, as Trino is special I like the u16, so mixed feelings here ^^
If we go with u16, we should do it in all places in the operator I'd say.

I feel like it makes sense to represent the Trino version as a number as that is what it appears to be.

In the case of Starburst, the operator behaviour of 467-e should be the same as 467. Of course, if that ends up being false and we support both, then we would need to refactor it.

I have updated the JVM module to be consistent: 2640426


More generally, I think we should try to encode the differences in versions rather than having specific supported versions in code. Of course there will be versions we haven't validated against, but also we don't list them as supported, so I feel that is ok.

If all of our products versions can be coerced into semver, that could help too. That way we can still leverage PartialEq and PartialOrd. That could at least keep things consistent across the operators.

But at some point, there will be inconsistency and I think that is ok too. They are all wildly different products with whatever versioning scheme their respective maintainers choose.

Comment on lines 101 to 102
// Trino 469 deprecates the Legacy S3 (via the Hadoop FS interface) implementation.
// Trino 470 completely removes Legacy S3 support.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, it's a bit tricky.
Can you please link to trinodb/trino#24878 in the comments?
According to it, it was deprecated in 470 and will be removed in the future.
No idea what happened before 470 that required this change ^^

Copy link
Member Author

@NickLarsenNZ NickLarsenNZ Feb 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While they only advertise the deprecation in 470, it was functionally deprecated in 469, hence this work to get around it.

I will link that issue you mentioned.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we're jumping straight to 470, would you like me to remove the comment about 469?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that makes sense, thanks!
But I let you decide

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second thought, I think we should still make the code valid even if we aren't shipping 469. We discovered the change necessary since then.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See improved comment in: 661fead

@sbernauer sbernauer changed the title feat: Add support for Trino 469 feat: Add support for Trino 470 Feb 10, 2025
rust/crd/src/lib.rs Outdated Show resolved Hide resolved
rust/crd/src/lib.rs Outdated Show resolved Hide resolved
// Copied from:
// - https://trino.io/docs/455/installation/deployment.html#jvm-config
// - https://trino.io/docs/469/installation/deployment.html#jvm-config
"455" | "469" => Ok(vec![
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"455" | "469" => Ok(vec![
"455" | "470" => Ok(vec![

Copy link
Member Author

@NickLarsenNZ NickLarsenNZ Feb 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been changed to support numeric ranges.
See: 2640426

Specifically:

// - https://trino.io/docs/455/installation/deployment.html#jvm-config
// - https://trino.io/docs/470/installation/deployment.html#jvm-config
455.. => Ok(vec![

rust/operator-binary/src/config/jvm.rs Outdated Show resolved Hide resolved
rust/operator-binary/src/config/jvm.rs Outdated Show resolved Hide resolved
rust/operator-binary/src/controller.rs Outdated Show resolved Hide resolved
rust/operator-binary/src/controller.rs Outdated Show resolved Hide resolved
tests/test-definition.yaml Outdated Show resolved Hide resolved
… S3 connections

Although it is technically possible to enable legacy S3 support in Trino 469, we have forced native s3 support since 469 so the warning is written that way.

## Changed

- BREAKING: Hard-code `s3.region=us-east-1` until it can be configured by the end user ([#705]).
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

We either need to merge with this in, or fix the CRD now to handle the s3 region.

@@ -2,5 +2,6 @@
// This is a separate file, since it is used by both the direct Trino documentation, and the overarching
// Stackable Platform documentation.

- 469
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 469
- 470

Comment on lines +105 to +110
// Trino silently fails to load if `s3.region` is not set.
// We will hard-code it for now so that Trino can work with IONOS
// and Minio, but this will eventually come in via `S3Connection`
// once the CRD has the field.
tracing::warn!("s3.region is currently hard-coded to us-east-1");
catalog_config.add_property("s3.region", "us-east-1");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

We either need to merge with this in, or fix the CRD now to handle the s3 region.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be in favor of adding the region to the S3Connection (via a decision). We need to think about defaults though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Development: In Progress
Development

Successfully merging this pull request may close these issues.

3 participants