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

Refactor the "replica_id" in requests

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      Today in many requests like fetch and offset we have a integer replica_id field, if the request is from a follower consumer it is the broker id from that follower replica, if it is from a regular consumer it could be one of the two values: "-1" for ordinary consumer, or "-2" for debugging consumer.

      Hence this replica_id field is used in two folds:

      1) Logging for trouble shooting in request logs, which can be helpful only when this is from a follower replica,

      2) Deciding if it is from the consumer or a replica to logically handle the request in different ways. For this purpose we do not really care about the actually id value.

      We probably would like to do the following improvements:

      1) Rename "replica_id" to sth. less confusing?

      2) Change the request.toString() function based on the replica_id, whether it is a positive integer (meaning from a broker replica fetcher) or -1/-2 (meaning from a regular consumer).

      Attachments

        Activity

          People

            baluchicken Balint Molnar
            guozhang Guozhang Wang
            Neha Narkhede Neha Narkhede
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated: