-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[fix][fn] Add missing version
field back to querystate
API
#21966
[fix][fn] Add missing version
field back to querystate
API
#21966
Conversation
1b256d9
to
6c0810f
Compare
pulsar-functions/api-java/src/main/java/org/apache/pulsar/functions/api/state/StateValue.java
Outdated
Show resolved
Hide resolved
...ions/instance/src/main/java/org/apache/pulsar/functions/instance/state/BKStateStoreImpl.java
Outdated
Show resolved
Hide resolved
...ions/instance/src/main/java/org/apache/pulsar/functions/instance/state/BKStateStoreImpl.java
Show resolved
Hide resolved
...e/src/main/java/org/apache/pulsar/functions/instance/state/PulsarMetadataStateStoreImpl.java
Outdated
Show resolved
Hide resolved
What caused the |
...integration/src/test/java/org/apache/pulsar/tests/integration/functions/PulsarStateTest.java
Show resolved
Hide resolved
...ions/instance/src/main/java/org/apache/pulsar/functions/instance/state/BKStateStoreImpl.java
Outdated
Show resolved
Hide resolved
It's partly resolved, if the backend state store can specify whether a state value is a number(BK supports this), it won't return But if a backend state store doesn't have such ability, we can't tell whether a state value is a number even its length is |
pulsar-functions/api-java/src/main/java/org/apache/pulsar/functions/api/state/StateValue.java
Outdated
Show resolved
Hide resolved
pulsar-functions/api-java/src/main/java/org/apache/pulsar/functions/api/state/StateValue.java
Outdated
Show resolved
Hide resolved
...ions/instance/src/main/java/org/apache/pulsar/functions/instance/state/BKStateStoreImpl.java
Show resolved
Hide resolved
This happened with BK and 3.2.0 rc4. What does it mean that it's partly resolved? |
pulsar-functions/api-java/src/main/java/org/apache/pulsar/functions/api/state/StateValue.java
Show resolved
Hide resolved
When using the BK state store, it won't return But if users use another state store, this state store may not be able to specify whether a state value is a number or a string(such as the This is also the reason why the type of I think this is fine, because before this PR and #21597, the |
/pulsarbot rerun-failure-checks |
Fixes #xyz
Main Issue: #xyz
PIP: #xyz
Motivation
#21597 introduce a change that always uses
null
for theversion
field for thequerystate
API. This may break users' behavior, need to add it backModifications
org.apache.pulsar.functions.api.state.StateValue
, which containsvalue
,version
, andisNumber
fields.org.apache.pulsar.functions.api.state.ByteBufferStateStore
interface, both of which return aStateValue
:DefaultStateStore#getStateValue
method instead ofDefaultStateStore#get
inorg.apache.pulsar.functions.worker.rest.api.ComponentImpl
to get theversion
field from the backend state store and return it to users.Verifying this change
Make sure that the change passes the CI checks.
This change added tests and can be verified as follows:
getStateValue
andgetStateValueAsync
PulsarStateTest#testPythonWordCountFunction
, now it will check theversion
field too.Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: jiangpengcheng#24