Skip to content

Support sticky consumer in Key_Shared subscription #4169

Closed

Description

@sijie

Is your feature request related to a problem? Please describe.

Master Issue: #4077

In supporting exactly-once stateful processing in Flink with Pulsar, the source function should be able to choose a key range to consume. So the events of a key range in a given partition would always be sent to the consumer to ensure the correctness for stateful processing. Because in Flink all the state management are locally to the instances. We need to make sure all the events for a given key range is always sent to a same instance.

Describe the solution you'd like

  • A consumer can subscribe with a key range for a partition. Such consumer is called a Sticky consumer.
  • A sticky consumer can exclusively consume the messages from that key range for a partition.
  • For a non-sticky consumer, they can consume the remaining key ranges that are not occupied by sticky consumers.

So in implementing Flink exactly-once connector, the Flink source can compute the key ranges based on the number of instances. Each instance will be consuming the events in a key range of a partition. This allows us scaling up the number of Flink instances without increasing the number of partitions, and also guaranteeing exactly-once stateful processing.

Describe alternatives you've considered

N/A. If we don't do so, we have to scale up the number of partitions. This couples producers and consumers to make a decision. The producers are typically owned by a business service team, while the consumers are owned by analytics team.

Additional context

The requirement comes from Pulsar + Flink integration for exactly-once stateful processing.

Activity

  1. added
    type/feature
    on Apr 29, 2019
  2. sijie commented on Apr 29, 2019

    @sijie
    MemberAuthor
  3. added this to the 2.5.0 milestone on May 19, 2019
  4. removed this from the 2.5.0 milestone on Nov 25, 2019
  5. sijie commented on Jan 14, 2020

    @sijie
    MemberAuthor

    This has been fixed by #5388 and #5928

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

    type/feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions