You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
As functions can manipulate states, race conditions may occur if multiple instance of the same function are processed in parallel and update state for the same key.
Describe the solution you'd like
having a Key_Shared mode for a function's instances - similar to Key_Shared subscription mode for consumers - would provide the guarantee that only one function instance would run at any time for a given key
Describe alternatives you've considered
Another solution could be to have transactions enabled for states, but i'm not sure it's even possible with BookKeeper.
Additional context
Reacted by Konstantinos Papalias, Dmitriy Khokhlov, Vladimir Shchur and hpvd
Does it mean this issue should be closed with 2.7?
Yes, in 2.7.0, we can use this feature.
Is there somewhere in the documentation explaining how to use it this feature?
@sijie It seems that we need to expose the corresponding parameters to users. Currently, when creating pulsar function, --retain-key-ordering is not exposed.
@sijie It seems that we need to expose the corresponding parameters to users. Currently, when creating pulsar function, --retain-key-ordering is not exposed.
Is there a turnaround to be able to use it? Is that enough to set functionConfig.retainKeyOrdering = true if using PulsarAdmin java?
Activity
Lanayx commentedon Nov 30, 2020
@sijie Hi, is adding key shared mode on the roadmap soon?
sijie commentedon Nov 30, 2020
@Lanayx I think @wolfstudy is picking that up already.
wolfstudy commentedon Dec 1, 2020
Yes, we already support key_shared mode on pulsar functions in #7647.
Lanayx commentedon Dec 1, 2020
That's great news!
geomagilles commentedon Dec 4, 2020
Does it mean this issue should be closed with 2.7? Is there somewhere in the documentation explaining how to use it this feature?
wolfstudy commentedon Dec 7, 2020
Yes, in 2.7.0, we can use this feature.
@sijie It seems that we need to expose the corresponding parameters to users. Currently, when creating pulsar function,
--retain-key-orderingis not exposed.geomagilles commentedon Dec 7, 2020
Is there a turnaround to be able to use it? Is that enough to set
functionConfig.retainKeyOrdering = trueif using PulsarAdmin java?Add cmd flag of retain key ordering (#8886)
Add cmd flag of retain key ordering (apache#8886)
Add cmd flag of retain key ordering (apache#8886)