Skip to content

What is the need for using unique Kafka Consumer Group for ingestion job? #646

Closed

Description

@bharathelangovan

We are trying to figure out why a new consumer group is created when an ingestion job is started. This means that if there is a gap between the termination and starting of a Dataflow job there will be a data within the Kafka topic that is not ingested
https://github.com/gojek/feast/blob/196f7112f0c4ba58f2417e0c9856dac07435e0be/ingestion/src/main/java/feast/ingestion/transform/ReadFromSource.java#L86
We would like to know if this was intentional and if so what are the ways to avoid data loss?

Activity

  1. ches commented on Apr 24, 2020

    @ches
    Member

    Glad someone asked, we’ve patched this internally and I hadn’t thought to raise the question upstream yet.

    Essentially we base the consumer group names on Source ID and the target Store name. It’s not quite a cherry-pick for me to bring it to an upstream PR because there’s one extra element specific to our use that probably is not generally appropriate, but it’s a small patch to extract if no one sees problems with the approach.

  2. added
    kind/question
    on Apr 24, 2020
  3. davidheryanto commented on Apr 25, 2020

    @davidheryanto
    Collaborator

    Thanks for bringing this up.

    I think early on Feast Core didn't have the ability to ensure jobs are always running to ingest the FeatureSets applied.

    That is, if a job is stopped, it won't be automatically restarted until the FeatureSet is reapplied again.

    In such situation, it is possible that a job is stopped, then only after a "long" period of time it is started again (when the FeatureSet is reapplied).

    For a FeatureSet with a high throughput Source, it is likely that during the period the job is stopped, the lag becomes incredibly high that if the job is to continue from the last offset it may not be able to keep up. Also, this very old data may have less value than the most recent one. But because the job cannot catch up, it cannot ingest fresh data as a result. That's why when a job is stopped, it is assigned a new consumer group id when started again so it will read from the latest offset in the Source.

    However, now that Feast Core always ensures there are jobs running to ingest the FeatureSet applied, I think it makes sense for us to change the behaviour such that the same consumer group id is used when the job is stopped, and then automatically restarted by Feast Core. Because Feast
    Core will very quickly attempt to restart the job, there will be no problem of the job not being able to catch up with the Source.

    As a side note, currently if a running job is restarted via an update i.e. reapplying an existing FeatureSet with same the Source and Store but new features, the same consumer group id will be retained. (This is different from stopping a job and then applying the FeatureSet because the updated FeatureSet is applied when the job is still running). And I think currently it only works with DataflowRunner.

  4. woop commented on Jun 21, 2020

    @woop
    Member

    Closed due to #757 (comment)

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

    kind/question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions