Versions Compared

Key

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

...

  1. --reassignment-batch-size — caps how many topic partitions are submitted per step (semantics differ slightly depending on mode; see below). 0 preserves legacy behavior (single request for the entire plan).
  2. --incremental — optional mode used with--reassignment-batch-size > 0 to keep at most Npartition reassignments in flight for this execution, submitting the next partition from a deterministic queue when a slot frees up.
  3. --reassignment-poll-interval-ms — how long the tool sleeps between polls while waiting for batch completion (non-incremental, between batches) and while driving incremental submissions; default 500 ms.

Ordering for both modes is (topic name, partition index), not the order of entries in the JSON file.

...

Option

Applies to

Semantics

--reassignment-batch-size <int>

--execute only

  • Default 0: legacy — entire plan in one alterPartitionReassignments request; no extra waits in the tool.
  • > 0 without --incremental: split the plan into contiguous batches of at most N partitions (sorted by topic, then partition id). After each batch except the last, the tool blocks until every partition in that batch reports complete (current ISR matches target and reassignment not active) before submitting the next batch.
  • > 0 with --incremental: N is the maximum number of partition reassignments from this JSON that may be active at once; when one completes, the tool submits the next partition from the sorted queue.

--incremental

--execute only

Requires --reassignment-batch-size > 0. Mutually exclusive interpretation of batch size as in-flight cap (see above).

--reassignment-poll-interval-ms <long>

--execute only

Milliseconds to sleep between progress polls when the tool is waiting on reassignment state. Default 500

Validation and compatibility

...

  • int reassignmentBatchSize
  • boolean incremental
  • long reassignmentPollIntervalMs

Existing callers that omit pacing pass 0 and false to preserve legacy behaviour.

...

  1. Sort partitions deterministically (compareTopicPartitions).
  2. Maintain a pending deque and an in-flight map (submissions for this execute only).
  3. Loop until pending is empty: remove completed partitions from in-flight (using the same completion predicate as non-incremental wait paths), then submit new partitions up to the N in-flight cap.
  4. Poll interval between iterations when work remains: INCREMENTAL_REASSIGNMENT_POLL_INTERVAL_MS (500 ms in the default implementation).

...

Non-incremental wait between batches

  • Poll interval: BATCH_REASSIGNMENT_POLL_INTERVAL_MSreassignmentPollIntervalMs (500 ms in the reference implementation).
  • Completion uses existing findPartitionReassignmentStates / PartitionReassignmentState logic; inconsistent terminal states produce TerseException (same class of errors as today’s verify path).

...