[fix][fn] Add missing version field back to querystate API#21966
Conversation
1b256d9 to
6c0810f
Compare
What caused the |
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 |
This happened with BK and 3.2.0 rc4. What does it mean that it's partly 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
nullfor theversionfield for thequerystateAPI. This may break users' behavior, need to add it backModifications
org.apache.pulsar.functions.api.state.StateValue, which containsvalue,version, andisNumberfields.org.apache.pulsar.functions.api.state.ByteBufferStateStoreinterface, both of which return aStateValue:DefaultStateStore#getStateValuemethod instead ofDefaultStateStore#getinorg.apache.pulsar.functions.worker.rest.api.ComponentImplto get theversionfield 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:
getStateValueandgetStateValueAsyncPulsarStateTest#testPythonWordCountFunction, now it will check theversionfield too.Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: jiangpengcheng#24