Skip to content

Fix create_partitions sending empty assignments array instead of null - #3148

Merged
dpkp merged 4 commits into
masterfrom
dpkp/create-partitions-null-assignments
Aug 4, 2026
Merged

Fix create_partitions sending empty assignments array instead of null#3148
dpkp merged 4 commits into
masterfrom
dpkp/create-partitions-null-assignments

Conversation

@dpkp

@dpkp dpkp commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Fixes #3146

Co-authored-by: ebrard emmanuel.brard@getyourguide.com

ebrard and others added 4 commits August 4, 2026 10:30
_process_create_partitions_input always built the per-topic assignments
field as a list. For the int total-count form (and a bare NewPartitions
with no manual assignments) this produced an empty list [], which
serialises to a present-but-empty array. The broker reads that as a
manual replica assignment and rejects the request with
InvalidReplicationAssignmentError.

Pass assignments=None when the caller supplies no manual assignments so
it serialises to null and the broker auto-assigns replicas. Add unit
coverage for the auto-assign and manual-assignment paths.

Fixes #3146
@dpkp
dpkp merged commit eaa45b7 into master Aug 4, 2026
20 checks passed
@dpkp
dpkp deleted the dpkp/create-partitions-null-assignments branch August 4, 2026 23:32
dpkp added a commit that referenced this pull request Aug 4, 2026
…#3148)

Co-Authored-By: ebrard <emmanuel.brard@getyourguide.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KafkaAdminClient.create_partitions with int total count fails with InvalidReplicationAssignmentError (sends empty assignments array instead of null)

2 participants