Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Request

Code Block
{
  "apiKey": 56 56,
  "type":  "request",
  "listeners": ["zkBroker",  "controller"],
  "name":  "AlterPartitionRequest",
  "validVersions":  "0-23",
  "flexibleVersions":  "0+",
  "fields": [
    {  "name":  "BrokerId",  "type":  "int32",  "versions":  "0+",  "entityType":  "brokerId",
      "about":  "The ID of the requesting broker"  },
    {  "name":  "BrokerEpoch",  "type":  "int64",  "versions":  "0+",  "default":  "-1",
      "about":  "The epoch of the requesting broker"  },
    {  "name":  "Topics",  "type":  "[]TopicData",  "versions":  "0+",  "fields": [
      {  "name":  "TopicName",  "type":  "string",  "versions":  "0-1",  "ignorable": true true,  "entityType":  "topicName",
        "about":  "The name of the topic to alter ISRs for"  },
      {  "name":  "TopicId",  "type":  "uuid",  "versions":  "2+",  "ignorable": true true,
        "about":  "The ID of the topic to alter ISRs for"  },
      {  "name":  "Partitions",  "type":  "[]PartitionData",  "versions":  "0+",  "fields": [
        {  "name":  "PartitionIndex",  "type":  "int32",  "versions":  "0+",
          "about":  "The partition index"  },
        {  "name":  "LeaderEpoch",  "type":  "int32",  "versions":  "0+",
          "about":  "The leader epoch of this partition"  },
// Old Field deprecated.
        {  "name":  "NewIsr",  "type":  "[]int32",  "versions":  "0-2",  "entityType":  "brokerId",
          "about":  "The ISR for this partition"  },
// Old Field deprecated.
// New Field begin
        {  "name":  "NewIsrWithEpochs",  "type":  "[]BrokerState",  "versions":  "3+",  "fields": [
            {  "name":  "BrokerId",  "type":  "int32",  "versions":  "3+",  "entityType":  "brokerId",
              "about":  "The ID of the broker."  },
        	{  "name":  "BrokerEpoch",  "type":  "int64",  "versions":  "3+", "default": "-1",
                             "about":  "The epoch of the broker. It will be -1 if the epoch check is not supported."  },
         ]},
// New Field End
        {  "name":  "LeaderRecoveryState",  "type":  "int8",  "versions":  "1+",  "default":  "0",
          "about":  "1 if the partition is recovering from an unclean leader election; 0 otherwise."  },
        {  "name":  "PartitionEpoch",  "type":  "int32",  "versions":  "0+",
          "about":  "The expected epoch of the partition which is being updated. For legacy cluster this is the ZkVersion in the LeaderAndIsr request."  }
      ]}
    ]}
  ]
}

Fetch request RPC

Code Block
linenumberstrue
{
  "apiKey": 1 1,
  "type":  "request",
  "listeners": ["zkBroker",  "broker",  "controller"],
  "name":  "FetchRequest",
  "validVersions":  "0-1314",
  "flexibleVersions":  "12+",
  "fields": [
    {  "name":  "ClusterId",  "type":  "string",  "versions":  "12+",  "nullableVersions":  "12+",  "default":  "null",
      "taggedVersions":  "12+",  "tag": 0 0,  "ignorable": true true,
      "about":  "The clusterId if known. This is used to validate metadata fetches prior to broker registration."  },
// Rename the ReplicaId to BrokerId as we will bump the api version
    {  "name": "ReplicaId",  "ReplicaId", "type": "int32", "versions": "0+", "entityType": "brokerId",
      "about": "The broker ID of the follower, of -1 if this request is from a consumer." },
    { "name": "BrokerId", "type":  "int32",  "versions":  "0+",  "entityType":  "brokerId",
      "about":  "The broker ID of the follower, of -1 if this request is from a consumer."  },
// Rename ends

// New Field begin
        {  "name":  "BrokerEpoch",  "type":  "int64",  "versions":  "14+",  "ignorable": true true,
          "about":  "The epoch of this follower."  },
// New Field End
    {  "name":  "MaxWaitMs",  "type":  "int32",  "versions":  "0+",
      "about":  "The maximum time in milliseconds to wait for the response."  },
    {  "name":  "MinBytes",  "type":  "int32",  "versions":  "0+",
      "about":  "The minimum bytes to accumulate in the response."  },
    {  "name":  "MaxBytes",  "type":  "int32",  "versions":  "3+",  "default":  "0x7fffffff",  "ignorable": true true,
      "about":  "The maximum bytes to fetch.  See KIP-74 for cases where this limit may not be honored."  },
    {  "name":  "IsolationLevel",  "type":  "int8",  "versions":  "4+",  "default":  "0",  "ignorable": true true,
      "about":  "This setting controls the visibility of transactional records. Using READ_UNCOMMITTED (isolation_level = 0) makes all records visible. With READ_COMMITTED (isolation_level = 1), non-transactional and COMMITTED transactional records are visible. To be more concrete, READ_COMMITTED returns all data from offsets smaller than the current LSO (last stable offset), and enables the inclusion of the list of aborted transactions in the result, which allows consumers to discard ABORTED transactional records"  },
    {  "name":  "SessionId",  "type":  "int32",  "versions":  "7+",  "default":  "0",  "ignorable": true true,
      "about":  "The fetch session ID."  },
    {  "name":  "SessionEpoch",  "type":  "int32",  "versions":  "7+",  "default":  "-1",  "ignorable": true true,
      "about":  "The fetch session epoch, which is used for ordering requests in a session."  },
    {  "name":  "Topics",  "type":  "[]FetchTopic",  "versions":  "0+",
      "about":  "The topics to fetch.",  "fields": [
      {  "name":  "Topic",  "type":  "string",  "versions":  "0-12",  "entityType":  "topicName",  "ignorable":  "true",
        "about":  "The name of the topic to fetch."  },
      {  "name":  "TopicId",  "type":  "uuid",  "versions":  "13+",  "ignorable": true true,  "about":  "The unique topic ID"},
      {  "name":  "Partitions",  "type":  "[]FetchPartition",  "versions":  "0+",
        "about":  "The partitions to fetch.",  "fields": [
        {  "name":  "Partition",  "type":  "int32",  "versions":  "0+",
          "about":  "The partition index."  },
        {  "name":  "CurrentLeaderEpoch",  "type":  "int32",  "versions":  "9+",  "default":  "-1",  "ignorable": true true,
          "about":  "The current leader epoch of the partition."  },
        {  "name":  "FetchOffset",  "type":  "int64",  "versions":  "0+",
          "about":  "The message offset."  },
        {  "name":  "LastFetchedEpoch",  "type":  "int32",  "versions":  "12+",  "default":  "-1",  "ignorable": false false,
          "about":  "The epoch of the last fetched record or -1 if there is none"},
        {  "name":  "LogStartOffset",  "type":  "int64",  "versions":  "5+",  "default":  "-1",  "ignorable": true true,
          "about":  "The earliest available offset of the follower replica.  The field is only used when the request is sent by the follower."},
        {  "name":  "PartitionMaxBytes",  "type":  "int32",  "versions":  "0+",
          "about":  "The maximum bytes to fetch from this partition.  See KIP-74 for cases where this limit may not be honored."  }
      ]}
    ]},
    {  "name":  "ForgottenTopicsData",  "type":  "[]ForgottenTopic",  "versions":  "7+",  "ignorable": false false,
      "about":  "In an incremental fetch request, the partitions to remove.",  "fields": [
      {  "name":  "Topic",  "type":  "string",  "versions":  "7-12",  "entityType":  "topicName",  "ignorable": true true,
        "about":  "The topic name."  },
      {  "name":  "TopicId",  "type":  "uuid",  "versions":  "13+",  "ignorable": true true,  "about":  "The unique topic ID"},
      {  "name":  "Partitions",  "type":  "[]int32",  "versions":  "7+",
        "about":  "The partitions indexes to forget."  }
    ]},
    {  "name":  "RackId",  "type":  "string",  "versions":  "11+",  "default":  "",  "ignorable": true true,
      "about":  "Rack ID of the consumer making this request"}
  ]
}

...