Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Changes to Delete(Topics|Records)(Request|Response)

...

The existing policy interfaces CreateTopicPolicy and AlterConfigPolicy will be deprecated, but will continue to be applied where they are currently applied until they are removed.

New versions of existing network protocol DeleteTopicsRequest and DeleteRecordsRequest will be added, to add a validate_only flag.

New versions of existing network protocol DeleteTopicsResponse and DeleteRecordsResponse will be added to include an error message.

Proposed Changes

Add TopicManagementPolicy and supporting interfaces

...

If, in the future, AdminClient.alterConfigs()/AlterConfigsRequest is changed to support changing broker configs a separate policy interface can be applied to such changes.

Add new versions of DeleteTopicsRequest and DeleteTopicsResponse

The DELETE_TOPICS protocol have a 3rd version added (version 2). The DeleteTopicsRequest will get a validate_only flag. When this is set the request will be validated for correctness, including that it satisfies the  TopicManagementPolicy.validateDeleteTopic() method, but the topic won't actually be deleted.

No Format
DeleteTopics Request (Version: 2) => [topics] timeout validate_only
  topics => STRING
  timeout => INT32
  validate_only => BOOLEAN

The DeleteTopicsResponse will get the ability to include error messages in addition to error codes:

No Format
DeleteTopics Response (Version: 2) => throttle_time_ms [topic_error_codes] 
  throttle_time_ms => INT32
  topic_error_codes => topic error_code error_message
    topic => STRING
    error_code => INT16
    error_message => NULLABLE_STRING

Existing versions of the DeleteTopics resonse will be able to have error_codes with value POLICY_VIOLATION.

The documentation for AdminClient.deleteTopics() will be updated mention the possibility of PolicyViolationException from the DeleteTopicsResult methods.

Add new versions of DeleteRecordsRequest and DeleteRecordsResponse

The DELETE_RECORDS protocol have a 2nd version added (version 1). The DeleteRecordsRequest will get a validate_only flag. When this is set the request will be validated for correctness, including that it satisfies the  TopicManagementPolicy.validateDeleteRecords() method, but no records will be deleted.

No Format
DeleteRecords Request (Version: 1) => [topics] timeout validate_only
  topics => topic [partitions] 
    topic => STRING
    partitions => partition offset 
      partition => INT32
      offset => INT64
  timeout => INT32
  validate_only => BOOLEAN

The DeleteRecordsResponse will get the ability to include error messages in addition to error codes:

No Format
DeleteRecords Response (Version: 0) => throttle_time_ms [topics] 
  throttle_time_ms => INT32
  topics => topic [partitions] 
    topic => STRING
    partitions => partition low_watermark error_code error_message
      partition => INT32
      low_watermark => INT64
      error_code => INT16
      error_message => NULLABLE_STRING

Existing versions of the DeleteRecords resonse will be able to have error_codes with value POLICY_VIOLATION.

The documentation for AdminClient.deleteRecords() (being added by KIP-204) will be updated mention the possibility of PolicyViolationException from the DeleteRecordsResult methods.

Compatibility, Deprecation, and Migration Plan

...