Skip to content

feat(inkless:consolidation): add separate wiring for consolidation fetcher [KC-160]#635

Merged
viktorsomogyi merged 2 commits into
mainfrom
jeqo/consolidation-configs
Jun 9, 2026
Merged

feat(inkless:consolidation): add separate wiring for consolidation fetcher [KC-160]#635
viktorsomogyi merged 2 commits into
mainfrom
jeqo/consolidation-configs

Conversation

@jeqo

@jeqo jeqo commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Consolidation fetcher gets its own configuration surface independent of the shared consumer fetch path:

  • diskless.consolidation.fetch.max.bytes (default: 1MB, per-partition)
  • diskless.consolidation.fetch.response.max.bytes (default: 10MB, response-level)
  • diskless.consolidation.fetch.min.bytes (default: 1)
  • diskless.consolidation.fetch.max.wait.ms (default: 500ms)
  • diskless.consolidation.num.fetchers (default: 1)
  • diskless.consolidation.fetch.find.batches.max.per.partition (default: 0 = unlimited)

Per-partition and response-level max bytes are separate configs (same pattern as replica.fetch.max.bytes vs replica.fetch.response.max.bytes) so they can be tuned independently when multiple partitions share one fetcher thread.

Separate metrics group (ConsolidationFetchMetrics) so consolidation fetch metrics are distinguishable from consumer fetch metrics in JMX.

Reader gains a constructor accepting KafkaMetricsGroup for injection, and InklessFetchMetrics accepts a custom metrics group. The consolidation FetchHandler constructs its own Reader with these overrides wired from KafkaConfig, and is properly closed during broker shutdown.

@jeqo
jeqo force-pushed the jeqo/consolidation-configs branch 2 times, most recently from 2e291f8 to 85f2892 Compare June 5, 2026 16:40
@jeqo jeqo changed the title feat(inkless:consolidation): add separate configs and metrics for consolidation fetcher [KC-160] feat(inkless:consolidation): add separate wiring for consolidation fetcher [KC-160] Jun 5, 2026
@jeqo
jeqo requested a review from Copilot June 5, 2026 16:41
@jeqo
jeqo marked this pull request as ready for review June 5, 2026 16:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a dedicated configuration and metrics surface for the consolidation fetcher so it can be tuned and observed independently from the shared diskless consumer fetch path, while also ensuring consolidation-owned fetch resources are properly closed on broker shutdown.

Changes:

  • Added diskless.consolidation.* broker configs for consolidation fetch sizing, wait/min-bytes behavior, fetcher parallelism, and control-plane batching limits.
  • Wired consolidation fetch to use these new configs (fetch request sizing + num.fetchers) and added tests validating both explicit values and defaults.
  • Extended the Inkless Reader/InklessFetchMetrics wiring to allow injecting a custom KafkaMetricsGroup and thread-name prefix to separate consolidation metrics and thread identities.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
storage/inkless/src/main/java/io/aiven/inkless/consume/Reader.java Adds constructor wiring for injectable metrics group + thread name prefix for consolidation-specific fetch resources.
storage/inkless/src/main/java/io/aiven/inkless/consume/InklessFetchMetrics.java Allows injecting a KafkaMetricsGroup so consolidation fetch metrics can be separated in JMX.
server-common/src/main/java/org/apache/kafka/server/config/ServerConfigs.java Defines new diskless.consolidation.* broker configs and defaults in CONFIG_DEF.
core/src/main/scala/kafka/server/KafkaConfig.scala Exposes the new consolidation configs as KafkaConfig fields.
core/src/main/scala/kafka/server/ReplicaManager.scala Creates a dedicated consolidation FetchHandler/Reader, and closes it during shutdown.
core/src/main/scala/io/aiven/inkless/consolidation/DisklessLeaderEndPoint.scala Uses consolidation-specific fetch sizing/wait configs when building fetch requests.
core/src/main/scala/io/aiven/inkless/consolidation/ConsolidationFetcherManager.scala Uses consolidation-specific fetcher thread count (disklessConsolidationNumFetchers).
core/src/test/scala/io/aiven/inkless/consolidation/DisklessLeaderEndPointTest.scala Adds tests asserting consolidation fetch config usage and default values.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread storage/inkless/src/main/java/io/aiven/inkless/consume/Reader.java
Comment thread storage/inkless/src/main/java/io/aiven/inkless/consume/InklessFetchMetrics.java Outdated
Comment thread server-common/src/main/java/org/apache/kafka/server/config/ServerConfigs.java Outdated
@jeqo
jeqo force-pushed the jeqo/consolidation-configs branch from 85f2892 to 9bc4d46 Compare June 5, 2026 16:53
@jeqo
jeqo requested a review from Copilot June 5, 2026 16:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comment thread storage/inkless/src/main/java/io/aiven/inkless/consume/Reader.java
…solidation fetcher

Consolidation fetcher gets its own configuration surface independent of
the shared consumer fetch path:
- diskless.consolidation.fetch.max.bytes (default: 10MB, per-partition)
- diskless.consolidation.fetch.response.max.bytes (default: 10MB, response-level)
- diskless.consolidation.fetch.min.bytes (default: 1)
- diskless.consolidation.fetch.max.wait.ms (default: 500ms)
- diskless.consolidation.num.fetchers (default: 1)
- diskless.consolidation.fetch.find.batches.max.per.partition (default: 0 = unlimited)
- diskless.consolidation.fetch.metadata.thread.pool.size (default: 4)
- diskless.consolidation.fetch.data.thread.pool.size (default: 8)

Per-partition and response-level max bytes are separate configs (same
pattern as replica.fetch.max.bytes vs replica.fetch.response.max.bytes)
so they can be tuned independently when multiple partitions share one
fetcher thread.

Separate metrics group (ConsolidationFetchMetrics) so consolidation
fetch metrics are distinguishable from consumer fetch metrics in JMX.

Reader gains a constructor accepting KafkaMetricsGroup for injection,
and InklessFetchMetrics accepts a custom metrics group. The consolidation
FetchHandler constructs its own Reader with these overrides wired from
KafkaConfig, with its own thread pools (smaller than consumer fetch since
consolidation is background work), and is properly closed during broker
shutdown.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jeqo
jeqo force-pushed the jeqo/consolidation-configs branch from 9bc4d46 to 42b611d Compare June 5, 2026 19:36
Comment thread server-common/src/main/java/org/apache/kafka/server/config/ServerConfigs.java Outdated
@jeqo
jeqo requested a review from viktorsomogyi June 9, 2026 08:52
@viktorsomogyi
viktorsomogyi merged commit 8f307b8 into main Jun 9, 2026
5 checks passed
@viktorsomogyi
viktorsomogyi deleted the jeqo/consolidation-configs branch June 9, 2026 09:03
jeqo added a commit that referenced this pull request Jun 10, 2026
…tcher [KC-160] (#635)

Consolidation fetcher gets its own configuration surface independent of the shared consumer fetch path:
- diskless.consolidation.fetch.max.bytes (default: 1MB, per-partition)
- diskless.consolidation.fetch.response.max.bytes (default: 10MB, response-level)
- diskless.consolidation.fetch.min.bytes (default: 1)
- diskless.consolidation.fetch.max.wait.ms (default: 500ms)
- diskless.consolidation.num.fetchers (default: 1)
- diskless.consolidation.fetch.find.batches.max.per.partition (default: 0 = unlimited)

Per-partition and response-level max bytes are separate configs (same pattern as replica.fetch.max.bytes vs replica.fetch.response.max.bytes) so they can be tuned independently when multiple partitions share one fetcher thread.

Separate metrics group (ConsolidationFetchMetrics) so consolidation fetch metrics are distinguishable from consumer fetch metrics in JMX.

Reader gains a constructor accepting KafkaMetricsGroup for injection, and InklessFetchMetrics accepts a custom metrics group. The consolidation FetchHandler constructs its own Reader with these overrides wired from KafkaConfig, and is properly closed during broker shutdown.
---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
jeqo added a commit that referenced this pull request Jun 10, 2026
…tcher [KC-160] (#635)

Consolidation fetcher gets its own configuration surface independent of the shared consumer fetch path:
- diskless.consolidation.fetch.max.bytes (default: 1MB, per-partition)
- diskless.consolidation.fetch.response.max.bytes (default: 10MB, response-level)
- diskless.consolidation.fetch.min.bytes (default: 1)
- diskless.consolidation.fetch.max.wait.ms (default: 500ms)
- diskless.consolidation.num.fetchers (default: 1)
- diskless.consolidation.fetch.find.batches.max.per.partition (default: 0 = unlimited)

Per-partition and response-level max bytes are separate configs (same pattern as replica.fetch.max.bytes vs replica.fetch.response.max.bytes) so they can be tuned independently when multiple partitions share one fetcher thread.

Separate metrics group (ConsolidationFetchMetrics) so consolidation fetch metrics are distinguishable from consumer fetch metrics in JMX.

Reader gains a constructor accepting KafkaMetricsGroup for injection, and InklessFetchMetrics accepts a custom metrics group. The consolidation FetchHandler constructs its own Reader with these overrides wired from KafkaConfig, and is properly closed during broker shutdown.
---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.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.

3 participants