Uploading a Pulsar Function with pulsar-admin 2.2.1 to a 2.4.0 broker causes validation failure
See original GitHub issueDescribe the bug If you use the pulsar-admin client bundled with the 2.2.1 client download with a 2.4.0 broker, uploading functions in a way that works with a 2.2.1 broker fails.
To Reproduce Steps to reproduce the behavior: Attempt to upload a function to a 2.4.0 broker with a 2.2.1 client.
Here’s an example function-config.yaml
:
tenant: "public"
namespace: "default"
inputs:
- "persistent://public/default/public-fooBar"
name: "fooBar"
py: "/Users/grant.wu/fooBar.py"
className: "fooBar.FooBar"
autoAck: true
parallelism: 1
processing-guarantees: AT_LEAST_ONCE
Command used for upload looks like this:
$PULSAR_DIR/bin/pulsar-admin functions create --functionConfigFile "$(realpath function-config.yaml)"
where $PULSAR_DIR
is the location of the extracted client tarball.
Expected behavior Completes as normal, or some sort of incompatibility message is presented.
Actual behavior Throws this error message:
The cpu allocation for the function must be positive
Desktop (please complete the following information):
- OS: Reproduced on macOS Mojave (10.14.5). Originally discovered on a Kubernetes (Linux) cluster.
Additional context it seems strange to me that it would behave like this, especially because the documentation implies that CPU is irrelevant for non-docker runtimes.
I have noticed within the Pulsar broker logs that with a 2.4.0 client, the cpu
field seems to be defaulted to 1.0
.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (7 by maintainers)
Top GitHub Comments
@grantwwu I was able to reproduce the issue with 2.2.1 client. I know what is going on. I will create a patch
Since 2.1 ~ 2.4 has been end of life for a while, it’s possible that the default value and null cases are handled properly.
Closed.
If it’s still relevant to the maintained versions, we can always take this patch back for a fix.