Enforce connector and SPI version match for Trino-maintained plugins#11774
Conversation
c590101 to
595af95
Compare
core/trino-main/src/main/java/io/trino/connector/ConnectorContextInstance.java
Outdated
Show resolved
Hide resolved
nineinchnick
left a comment
There was a problem hiding this comment.
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.
lib/trino-plugin-toolkit/src/main/java/io/trino/plugin/base/Versions.java
Outdated
Show resolved
Hide resolved
plugin/trino-accumulo/src/main/java/io/trino/plugin/accumulo/AccumuloConnectorFactory.java
Outdated
Show resolved
Hide resolved
|
@findepi 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. |
595af95 to
37a502e
Compare
|
@nineinchnick, @hashhar you were faster :)
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? |
|
@ssheikin i still don't understand your concerns. This adds checks to plugins maintained here, not to some proprietary plugins built and used somewhere. |
37a502e to
932108b
Compare
|
@findepi Thank you for clarification. Sounds reasonable. |
lib/trino-plugin-toolkit/src/main/java/io/trino/plugin/base/Versions.java
Outdated
Show resolved
Hide resolved
dfb02bb to
f98fad2
Compare
lib/trino-plugin-toolkit/src/main/java/io/trino/plugin/base/Versions.java
Outdated
Show resolved
Hide resolved
f98fad2 to
a495cf5
Compare
hashhar
left a comment
There was a problem hiding this comment.
Looks good to me (since it's plugin's choice to opt-into this).
|
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. |
bdac72d to
a947581
Compare
Build results depend on `git describe` equivalent (the git-commit-id maven plugin).
a947581 to
f13588c
Compare
Some CI tasks where still using shallow checkout, so git-commit-id plugin didn't work correctly. I added separate commit to change that. |
e90ff17 to
90ad2b3
Compare
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.
90ad2b3 to
9d792c5
Compare
core/trino-spi/src/main/java/io/trino/spi/connector/SpiVersionHolder.java
Show resolved
Hide resolved
|
CI #2330 |
|
CI #11747 |
|
|
||
| // 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). |
There was a problem hiding this comment.
magic... is that contract that will hold?
There was a problem hiding this comment.
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.