Skip to content

Having a Key_Shared mode for functions #6527

Closed

Description

@geomagilles

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

Activity

  1. added
    type/feature
    on Mar 12, 2020
  2. Lanayx commented on Nov 30, 2020

    @Lanayx
    Contributor

    @sijie Hi, is adding key shared mode on the roadmap soon?

  3. sijie commented on Nov 30, 2020

    @sijie
    Member

    @Lanayx I think @wolfstudy is picking that up already.

  4. wolfstudy commented on Dec 1, 2020

    @wolfstudy
    Member

    Yes, we already support key_shared mode on pulsar functions in #7647.

  5. Lanayx commented on Dec 1, 2020

    @Lanayx
    Contributor

    That's great news!

  6. geomagilles commented on Dec 4, 2020

    @geomagilles
    ContributorAuthor

    Does it mean this issue should be closed with 2.7? Is there somewhere in the documentation explaining how to use it this feature?

  7. wolfstudy commented on Dec 7, 2020

    @wolfstudy
    Member

    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.

  8. geomagilles commented on Dec 7, 2020

    @geomagilles
    ContributorAuthor

    @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?

  9. added a commit that references this issue on Dec 11, 2020
    8150da8
  10. added a commit that references this issue on Sep 14, 2021
    8eca78f
  11. added a commit that references this issue on Dec 20, 2021
    7da3f76
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/functiontype/feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions