Versions Compared

Key

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

...

  • ListTransactionsRequest 

Add a new tagged field, DurationFilter  to the ListTransactionsRequest  and bump the API's version

Code Block
{
  "apiKey": 66,
  "type": "request",
  "listeners": ["zkBroker", "broker"],
  "name": "ListTransactionsRequest",
  "validVersions": "0-1",
  "flexibleVersions": "0+",
  "fields": [
    { "name": "StateFilters", "type": "[]string", "versions": "0+",
      "about": "The transaction states to filter by: if empty, all transactions are returned; if non-empty, then only transactions matching one of the filtered states will be returned"
    },
    { "name": "ProducerIdFilters", "type": "[]int64", "versions": "0+", "entityType": "producerId",
      "about": "The producerIds to filter by: if empty, all transactions will be returned; if non-empty, only transactions which match one of the filtered producerIds will be returned"
    },
		{ "name": "DurationFilter", "type": "long", "versions": "01+", "tag": 10000, "taggedVersions": "0+",
			"about": "Return trsanactions running longer than this time duration, specified in milliseconds"
		}
  ]
}

...

Compatibility, Deprecation, and Migration Plan

Given Since we are adding tagged fields to ListTransactionsRequest  and field to DescribeTransactionsResponse , this does not need a version bump and there is no compatibility issue. The enhanced functionality will work only when both AdminClient  and Kafka broker are updated.

We do need to bump API version for ListTransactionsRequest from 0 to 1. In case a new AdminClient is sending durationFilter (greater than 0) to an older broker, ListTransactionsRequest will fail to build at the client side. This will require some check to be made at ListTransactionsRequest.Builder.build(short version) method. A new AdminClient can still generate older version of ListTransactionsRequest when it sets durationFilter to 0.

Rejected Alternatives

An alternative to enhancing these tools is to enable debug logging and parse through coordinator logs to get information like completion time and run duration for a transaction. Its better to enhance the tools (fix in case of DescribeTransactions ) to provide a unified and convenient user experience.