-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Pulsar Functions and IO] Cannot upgrade Function built for Pulsar 2.7 to Pulsar 2.8 #11338
Comments
@eolivelli will take a look. |
I did some check.
User need to compile their function code with pulsar 2.8.0 dependency in order to avoid this problem. And after recomplie, the problem is resolved:
And if a function compiled with 2.8.0 dependency is submitted to Pulsar Cluster 2.7.2, the following error reported:
|
@nlu90 that's exactly the same problem that I found. As discussed in the mailing list we have to add a note in the release notes about the upgrade path. I will send a PR against the website @Anonymitaet |
Describe the bug
Pulsar Functions and Pulsar IO connectors that use the Pulsar Client API, in particular the "Schema" API (like
Schema.JSON(Pojo.class)
) do not work anymore if you upgrade your Pulsar cluster to Pulsar 2.8.x.This is because of an
IncompatibleClassChangeError
around the classSchemaInfo
that was a "class" in Pulsar 2.7 and now it is a pure interface in Pulsar 2.8 (see commit 89ac98e).The error is:
To Reproduce
In order to reproduce the error follow these steps:
The workaround is to rebuild the Function against the 2.8.0 API (and switch from pulsar-client to pulsar-client-original! ) and to redeploy it.
Function body (taken from Pulsar Doc, with the addition of Schema.JSON):
pom.xml relevant deps:
Please note that in order to see the Function working you have to add the dependency to "pulsar-client", and "pulsar-client-api" is not enough (otherwise you will see a
ClassNotFoundException: org.apache.pulsar.client.impl.schema.JSONSchema
error.Expected behaviour
Upgrading Pulsar must be seamless, and the functions must continue working without changes.
Additional considerations
This is a bad problem for people who try to upgrade Pulsar from 2.7 to 2.8 because you may have many functions and you will need to rebuild them from source.
Therefore it is not possible to make the upgrade without interrupting the service, because you have to upgrade Pulsar and then upgrade the Function. It is not possible to build the function against 2.8.0 and then see it working on Pulsar 2.7
The text was updated successfully, but these errors were encountered: