Versions Compared

Key

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

Table of Contents

Status

Current state: Under Discussion

...

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

Motivation

KIP-482 added support optional tagged fields. Tagged fields require no space when they're omitted from RPCs using flexible versions.
A 16 bit ErrorCode  is used in the vast majority of RPCs and will normally have value 0 (NONE). Similarly ErrorMessage will in these cases be null, but still requires a byte to store the string length.

...

This KIP proposes to use tagged fields for error codes and messages in almost all RPCs in order to optimize the usual case.

Public Interfaces

Change every RPC which has an ErrorCode (except SASL_HANDSHAKE, due to KAFKA-9577) as follows:

  • Increment the RPC version (both request and response), since we're making a previously required field optional
  • If the RPC is not using flexibleVerions then add it (just OFFSET_DELETE).
  • Add taggedVerions to all ErrorCode and ErrorMessage fields.

Proposed Changes


Compatibility, Deprecation, and Migration Plan

This change is backward compatible with existing clients.

Rejected Alternatives

Doing this for each RPC organically. This would mean a (long) period of inconsistency in how these fields are handled, would complicate other KIPs and would be easily forgotten about.