Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-9361

Consider being restrictive on overloaded commit function with specific partition->offsets

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • consumer
    • None

    Description

      Today in KafkaConsumer's overloaded commitSync / commitAsync that takes a specific map of partitions -> offsetAndMetadata, we actually do not check if the specified partitions belong to the consumer if auto-assignment is used (i.e. `consumer.subscribe`). Which means that users can actually commit to any partitions they want, since on the broker side we do not check partition map either but only the generation.

      It worth some discussion whether we want to make it more restrictive – and the key question is that today for those we use these overloaded functions with not-owned partitions, are they used intentionally (like using it as a back door) or actually by mistake (which then would be a bug on user's code that are not easily discovered).

      If anyone falls into the first case leveraging on these, please share your use cases and thoughts about making it more restrictive — or of course, your rationales against it

      We should not start preparing a PR for it until there's some agreement.

      Attachments

        Activity

          People

            Unassigned Unassigned
            guozhang Guozhang Wang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: