Versions Compared

Key

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

...

  • UNASSIGNED_PARTITION (code 134)

Proposed Changes

Validation is added on the server side. The implementation differs based on whether KIP-1251: Assignment epochs for consumer groups#Handlingofstaticmembers has been applied.

Scenario 1: Without KIP-1251

Without KIP-1251, there is no This KIP builds on top of KIP-1251, which introduced a per-partition assignment epoch tracked on the broker. The server validates that For each partition in a TxnOffsetCommitRequest is actually assigned to the requesting member. This check is performed in ConsumerGroup.validateOffsetCommit() and only takes effect when membership information is present in the request. When a partition is not assigned to the member, the error is returned per-partition rather than failing the entire request, consistent with how other per-partition errors are handled in this API.owned by a member, the broker records the epoch at which that partition was assigned. This mechanism directly encodes assignment information in epoch form, enabling a unified validation rule:

assignmentEpoch(partition) ≤ clientEpoch ≤ brokerEpoch

This single check naturally handles all cases:

Partition statecurrentPartitionEpochResult
Not assigned to anyone-1STALE_MEMBER_EPOCH
Assigned to a different memberReflects the other member's epoch, not this member'sSTALE_MEMBER_EPOCH
Assigned to this member, epoch current≤ clientEpochAccepted
 Assigned to this member, heartbeat bumped broker epoch≤ clientEpoch ≤ brokerEpochAccepted

RPC changes

TxnOffsetCommitRequest and TxnOffsetCommitResponse are both bumped to version 6. Clients using version 6 or above opt into the new validation semantics.

...

Code Block
{
  "apiKey": 28,
  "type": "response",
  "name": "TxnOffsetCommitResponse",
  // skip
  // Version 6 adds support for new per-partition error code UNASSIGNED_PARTITION, returned when
  // a member attempts to commit offsets for a partition not assigned to it.
  "validVersions": "0-6",

Error code changes

A new non-retriable error code UNASSIGNED_PARTITION (code 134) is introduced. It is returned per-partition when a member attempts to commit a transactional offset for a partition it does not own. 

Scenario 2: With KIP-1251

...

,

...

assignmentEpoch(partition) ≤ clientEpoch ≤ brokerEpoch 

This single check naturally handles both cases:

...

...

Compatibility, Deprecation, and Migration Plan

...

New clients that explicitly send version 6 opt into the new validation semantics. Correctly implemented EOS applications — which should only commit offsets for partitions they currently own — will not be affected. Buggy applications that commit offsets for unassigned partitions will now receive UNASSIGNEDSTALE_MEMBER_PARTITION EPOCH per-partition rather than silently succeeding, which makes the bug visible and easier to diagnose.

...