Skip to content

feat(admin): support DescribeLogDirs v3–v5 and AlterPartitionReassignments v1 - #272

Merged
cookieMonsterDev merged 5 commits into
developfrom
feat/describe-log-dirs-v5-reassign-v1
Nov 27, 2026
Merged

cookieMonsterDev merged 5 commits into
developfrom
feat/describe-log-dirs-v5-reassign-v1

Conversation

@cookieMonsterDev

Copy link
Copy Markdown
Owner

Summary

Closes #270.

  • core (feat(admin)): DescribeLogDirs negotiates v0–v5.
    • v3 adds a request-level error code, which describeLogDirs throws.
    • v4 (Kafka 3.3+, KIP-827) adds totalBytes and usableBytes per log dir.
    • v5 (Kafka 4.3+) adds isCordoned.
    • Fields the broker does not send are left out of LogDirDescription, and so is a -1 (unreadable) volume size.
  • core: AlterPartitionReassignments negotiates v0–v1. alterPartitionReassignments accepts allowReplicationFactorChange (KIP-860, default true). On a broker that only speaks v0, false throws KafkaNonRetriableError instead of being silently ignored.
  • cli (feat(cli)):
    • cluster log-dirs prints a log-dir table (TOTAL_BYTES, USABLE_BYTES, CORDONED) ahead of the partition table.
    • cluster reassign execute gains --disallow-replication-factor-change.
  • studio (feat(studio)): the cluster overview gains a Log directories card, served by GET /api/cluster/log-dirs.
  • cli (fix(cli), found while testing on a live broker): the argument parser turns an omitted repeatable flag into []. Because of that, cluster log-dirs on develop failed with "No brokers available to describe log dirs" unless --broker was given, and showed no partitions unless --topic was.
  • test: the newest integration stack moves from Kafka 4.3 (apache/kafka:4.3.2) to Kafka 4.4 (apache/kafka:4.4.0). This covers core, CLI and Studio setup, the CI matrix and the docs that list the tested brokers. The benchmark broker follows, as benchmarks/docker/compose.yml asks; published benchmark results are unchanged. This was requested together with this change and is a separate commit, so it can be split into its own PR if preferred.

Behaviour change: a broker that refuses DescribeLogDirs (for example CLUSTER_AUTHORIZATION_FAILED) now makes describeLogDirs throw. Before, it returned no log dirs. This is documented in compatibility.md.

Screenshots or video

Cluster overview, 1280×1000. Before (develop):

Studio cluster overview before: stat tiles and the Cluster card only

After:

Studio cluster overview after: a Log directories card lists three brokers with path, used space bar, usable space and cordoned status

After, 390 px wide (the table scrolls inside its region):

The same overview at 390 px wide; the log directories table scrolls horizontally

Test plan

  • Unit tests (pnpm test) cover the change
  • Integration tests run if this touches brokers, protocol, SASL, or admin (KAFKA_VERSION=… pnpm --filter @cookiemonsterdev/kafka-core test:integration)
    • Core, full suite on 4.4: 228 passed, 8 skipped.
    • Core admin suites on 4.3, 4.0, 3.6 and 2.4: every new test passes.
    • CLI on 4.4: 33 passed. Studio on 4.4: 13 passed.
    • When test/suites/admin/log-dirs.test.ts runs on its own against a fresh cluster, the existing "describes replica log dirs" test fails, because it needs a topic created by another suite. It passes in the full suite. This predates this change.
  • Manual checks on a live 4.4 cluster:
    • cluster log-dirs prints both tables.
    • reassign execute --disallow-replication-factor-change on an RF-2→1 file reports Replication-factor is invalid and exits 1.
  • Docs or README updated when the public API or workflow changes. Skills validated with pnpm skills:validate.
  • Docs UI changes keep keyboard access, accessible names, visible focus, contrast, and prefers-reduced-motion (see CONTRIBUTING.md)
    • No docs UI change.
    • In the Studio card, the scroll region is focusable and labelled, the usage bar is aria-hidden, and usage is given as text.

Checklist

  • Branch name follows type/short-kebab-description (see CONTRIBUTING.md)
  • Commits follow Conventional Commits (feat, fix, …)
  • pnpm lint, pnpm format:check, and pnpm typecheck are clean
  • No unrelated refactors or formatting-only noise

The argument parser turns a repeatable flag that was not passed into an
empty array. cluster log-dirs read that as "no brokers" and "no topics",
so it failed with "No brokers available to describe log dirs" unless
--broker was given, and printed no partitions unless --topic was.
DescribeLogDirs now negotiates v0-v5. v3 adds a request-level error code,
which describeLogDirs throws; v4 adds each log dir's totalBytes and
usableBytes (KIP-827); v5 adds isCordoned. Fields the broker does not send,
and a -1 volume size, are left out of the result.

AlterPartitionReassignments now negotiates v0-v1, and
alterPartitionReassignments accepts allowReplicationFactorChange
(KIP-860, default true). Passing false to a broker that only speaks v0
throws instead of silently allowing the change.

Refs #270
cluster log-dirs prints a log-dir table with each volume's total and
usable bytes and whether the dir is cordoned, ahead of the partition
table. cluster reassign execute gains --disallow-replication-factor-change,
which needs Kafka 4.1+.

Refs #270
The cluster overview gains a log directories card: each broker's log
dirs with used and usable volume space and whether the dir is cordoned,
served by a new GET /api/cluster/log-dirs route.

Refs #270
Replace the Kafka 4.3 compose stack (apache/kafka:4.3.2) with Kafka 4.4
(apache/kafka:4.4.0) for core, CLI and Studio integration tests and the
CI matrix, and update the docs that list the tested brokers. The
benchmark broker follows, as benchmarks/docker/compose.yml asks; published
benchmark results still record the image they ran on.
@github-actions github-actions Bot added documentation Docs-only change or request package: core @cookiemonsterdev/kafka-core package: cli @cookiemonsterdev/kafka-cli package: docs @cookiemonsterdev/kafka-docs package: studio @cookiemonsterdev/kafka-studio labels Nov 27, 2026
@cookieMonsterDev
cookieMonsterDev merged commit a51dc5b into develop Nov 27, 2026
28 checks passed
@cookieMonsterDev
cookieMonsterDev deleted the feat/describe-log-dirs-v5-reassign-v1 branch November 27, 2026 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Docs-only change or request package: cli @cookiemonsterdev/kafka-cli package: core @cookiemonsterdev/kafka-core package: docs @cookiemonsterdev/kafka-docs package: studio @cookiemonsterdev/kafka-studio

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat]: DescribeLogDirs v3–v5 and AlterPartitionReassignments v1

1 participant