Skip to content

Enforce connector and SPI version match for Trino-maintained plugins#11774

Merged
findepi merged 3 commits intotrinodb:masterfrom
findepi:findepi/enforce-plugin-and-spi-version-match-b1ce30
Apr 6, 2022
Merged

Enforce connector and SPI version match for Trino-maintained plugins#11774
findepi merged 3 commits intotrinodb:masterfrom
findepi:findepi/enforce-plugin-and-spi-version-match-b1ce30

Conversation

@findepi
Copy link
Copy Markdown
Member

@findepi findepi commented Apr 4, 2022

While SPI intends to be backwards compatible, the plugins bundled with
the project do not intend to be compatible with any other engine or SPI
version than the ones they were build for. Sometimes users end up
deploying a plugin version that does not match the SPI version. This
can lead to hard to explain exceptions or even correctness problems,
especially if the connector relies on an engine feature that is not
present.

This commit adds version checks to all plugins bundled with the project.

@findepi findepi added the no-release-notes This pull request does not require release notes entry label Apr 4, 2022
@cla-bot cla-bot bot added the cla-signed label Apr 4, 2022
@findepi
Copy link
Copy Markdown
Member Author

findepi commented Apr 4, 2022

cc @nineinchnick

@findepi findepi force-pushed the findepi/enforce-plugin-and-spi-version-match-b1ce30 branch from c590101 to 595af95 Compare April 4, 2022 09:28
Copy link
Copy Markdown
Member

@nineinchnick nineinchnick left a comment

Choose a reason for hiding this comment

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

As an author of a few third-party plugins, I know this will cause me more work but I think it's a good idea. I was never sure the server will start up correctly, and now I'd know I have to update all my plugins.

I'd probably need to adjust the versioning scheme of my plugins to be more in sync with Trino, but that'd also make some things easier in the long term.

@ssheikin
Copy link
Copy Markdown
Contributor

ssheikin commented Apr 4, 2022

@findepi what if the plugin used with trino is a proprietary one with custom release schedule?

cc @lukasz-walkiewicz

@findepi
Copy link
Copy Markdown
Member Author

findepi commented Apr 4, 2022

As an author of a few third-party plugins, I know this will cause me more work but I think it's a good idea. I was never sure the server will start up correctly, and now I'd know I have to update all my plugins.

what if the plugin used with trino is a proprietary one with custom release schedule?

@nineinchnick @ssheikin @lukasz-walkiewicz

the check is done on the plugin side. There is no change for plugins maintained outside of this repository.
The 3rd party plugins MAY start using such checks (and I encourage everyone to do so), but are free not to do so.

@findepi findepi force-pushed the findepi/enforce-plugin-and-spi-version-match-b1ce30 branch from 595af95 to 37a502e Compare April 4, 2022 09:43
@ssheikin
Copy link
Copy Markdown
Contributor

ssheikin commented Apr 4, 2022

@nineinchnick, @hashhar you were faster :)

I'd probably need to adjust the versioning scheme of my plugins to be more in sync with Trino, but that'd also make some things easier in the long term.

I guess that would cause significant delays for upgrade of some trino installations which use proprietary plugins which in their turn relies on some other proprietary plugins. And now all that plugins must use the same trino SPI version now.

May be we have to enforce some window for backward compatible SPI versions?
cc @kokosing @lukasz-walkiewicz

@findepi
Copy link
Copy Markdown
Member Author

findepi commented Apr 4, 2022

@ssheikin i still don't understand your concerns. This adds checks to plugins maintained here, not to some proprietary plugins built and used somewhere.

@findepi findepi changed the title Enforce plugin and SPI version match Enforce connector and SPI version match for Trino-maintained plugins Apr 4, 2022
@findepi findepi force-pushed the findepi/enforce-plugin-and-spi-version-match-b1ce30 branch from 37a502e to 932108b Compare April 4, 2022 09:49
@ssheikin
Copy link
Copy Markdown
Contributor

ssheikin commented Apr 4, 2022

@findepi Thank you for clarification. Sounds reasonable.

Copy link
Copy Markdown
Member

@losipiuk losipiuk left a comment

Choose a reason for hiding this comment

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

LGTM

@findepi findepi force-pushed the findepi/enforce-plugin-and-spi-version-match-b1ce30 branch 2 times, most recently from dfb02bb to f98fad2 Compare April 4, 2022 12:39
@findepi findepi force-pushed the findepi/enforce-plugin-and-spi-version-match-b1ce30 branch from f98fad2 to a495cf5 Compare April 4, 2022 15:02
@findepi findepi requested a review from losipiuk April 4, 2022 15:02
Copy link
Copy Markdown
Member

@hashhar hashhar left a comment

Choose a reason for hiding this comment

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

Looks good to me (since it's plugin's choice to opt-into this).

@findepi
Copy link
Copy Markdown
Member Author

findepi commented Apr 5, 2022

The build is failing miserably, while it passes locally. I think it may be either related to merge commits, or to GIB. Going to investigate this.

@findepi findepi force-pushed the findepi/enforce-plugin-and-spi-version-match-b1ce30 branch from bdac72d to a947581 Compare April 5, 2022 09:16
Build results depend on `git describe` equivalent (the git-commit-id
maven plugin).
@findepi findepi force-pushed the findepi/enforce-plugin-and-spi-version-match-b1ce30 branch from a947581 to f13588c Compare April 5, 2022 13:22
@findepi
Copy link
Copy Markdown
Member Author

findepi commented Apr 5, 2022

The build is failing miserably, while it passes locally. I think it may be either related to merge commits, or to GIB. Going to investigate this.

Some CI tasks where still using shallow checkout, so git-commit-id plugin didn't work correctly. I added separate commit to change that.

@findepi findepi force-pushed the findepi/enforce-plugin-and-spi-version-match-b1ce30 branch from e90ff17 to 90ad2b3 Compare April 5, 2022 14:13
While SPI intends to be backwards compatible, the plugins bundled with
the project do not intend to be compatible with any other engine or SPI
version than the ones they were build for.  Sometimes users end up
deploying a plugin version that does not match the SPI version. This
can lead to hard to explain exceptions or even correctness problems,
especially if the connector relies on an engine feature that is not
present.

This commit adds version checks to all plugins bundled with the project.
@findepi findepi force-pushed the findepi/enforce-plugin-and-spi-version-match-b1ce30 branch from 90ad2b3 to 9d792c5 Compare April 5, 2022 14:20
@findepi
Copy link
Copy Markdown
Member Author

findepi commented Apr 6, 2022

CI #2330

@findepi
Copy link
Copy Markdown
Member Author

findepi commented Apr 6, 2022

CI #11747

@findepi findepi merged commit 664a2bf into trinodb:master Apr 6, 2022
@findepi findepi deleted the findepi/enforce-plugin-and-spi-version-match-b1ce30 branch April 6, 2022 15:18
@github-actions github-actions bot added this to the 376 milestone Apr 6, 2022

// Implementation version comes from Manifest and is defined in Airbase as equivalent to `git describe` output.
if (implementationVersion.matches(".*-(\\d+)-g([0-9a-f]+)(-dirty)?$")) {
// Specification version comes from Manifest and is the project version with `-SNAPSHOT` stripped, and .0 added (if not present).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

magic... is that contract that will hold?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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

Labels

cla-signed no-release-notes This pull request does not require release notes entry

Development

Successfully merging this pull request may close these issues.

7 participants