Skip to content

feat(inkless): add dedicated rate limit for consolidation fetch [KC-145]#636

Merged
viktorsomogyi merged 3 commits into
mainfrom
jeqo/ts-consolidation-rate-limit
Jun 10, 2026
Merged

feat(inkless): add dedicated rate limit for consolidation fetch [KC-145]#636
viktorsomogyi merged 3 commits into
mainfrom
jeqo/ts-consolidation-rate-limit

Conversation

@jeqo

@jeqo jeqo commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Introduce a separate ReplicationQuotaManager for consolidation fetchers, decoupled from the follower replication quota. This allows operators to cap object-storage read bandwidth (bytes/sec) without affecting regular replication.

Key changes:

  • Add DISKLESS_CONSOLIDATION_FETCH QuotaType (JMX: DisklessConsolidationFetch)
  • Add diskless.consolidation.fetch.rate.limit.bytes.per.second config
  • Wire dedicated quota manager via ConsolidationReconciler (marks topics throttled on partition add, ensuring bytes are recorded to the sensor)
  • Zip consolidationQuotaManager into fetcher manager creation (no silent fallback to shared follower quota)

Config lives in ServerConfigs (not InklessConfig) because:

  • It is a broker-level config accessed through KafkaConfig, same layer as num.replica.fetchers and leader.replication.throttled.rate
  • It uses the diskless.consolidation.* namespace alongside the existing diskless.remote.storage.consolidation.enable config
  • InklessConfig is for storage module internals (fetch pools, cache, upload) consumed by SharedState/Reader/Writer — not for fetcher-layer wiring

@jeqo
jeqo force-pushed the jeqo/ts-consolidation-rate-limit branch from 0548aab to 9831673 Compare June 5, 2026 20:14
@jeqo
jeqo changed the base branch from main to jeqo/consolidation-configs June 5, 2026 20:14
@jeqo
jeqo force-pushed the jeqo/ts-consolidation-rate-limit branch from 9831673 to fdc9e9a Compare June 5, 2026 23:39
Base automatically changed from jeqo/consolidation-configs to main June 9, 2026 09:03
Introduce a separate ReplicationQuotaManager for consolidation fetchers,
decoupled from the follower replication quota. This allows operators to
cap object-storage read bandwidth (bytes/sec) without affecting regular
replication.

Key changes:
- Add DISKLESS_CONSOLIDATION_FETCH QuotaType (JMX: DisklessConsolidationFetch)
- Add diskless.consolidation.fetch.rate.limit.bytes.per.second config
- Wire dedicated quota manager via ConsolidationReconciler (marks topics
  throttled on partition add, ensuring bytes are recorded to the sensor)
- Zip consolidationQuotaManager into fetcher manager creation (no silent
  fallback to shared follower quota)

Config lives in ServerConfigs (not InklessConfig) because:
- It is a broker-level config accessed through KafkaConfig, same layer as
  num.replica.fetchers and leader.replication.throttled.rate
- It uses the diskless.consolidation.* namespace alongside the existing
  diskless.remote.storage.consolidation.enable config
- InklessConfig is for storage module internals (fetch pools, cache, upload)
  consumed by SharedState/Reader/Writer — not for fetcher-layer wiring

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jeqo
jeqo force-pushed the jeqo/ts-consolidation-rate-limit branch from fdc9e9a to d0d005c Compare June 9, 2026 10:38
@jeqo
jeqo marked this pull request as ready for review June 9, 2026 10:39
@jeqo
jeqo requested review from Copilot and viktorsomogyi June 9, 2026 10:39

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 replication quota for Inkless consolidation fetchers so operators can rate-limit object-storage read bandwidth (bytes/sec) independently of follower replication throttling.

Changes:

  • Add a new QuotaType.DISKLESS_CONSOLIDATION_FETCH (JMX: DisklessConsolidationFetch) and a broker config diskless.consolidation.fetch.rate.limit.bytes.per.second.
  • Wire a dedicated ReplicationQuotaManager for consolidation fetchers via ReplicaManager/ConsolidationFetcherManager and pass it through ConsolidationReconciler.
  • Add unit tests validating quota behavior/independence and update reconciler tests for the new constructor parameter.

Reviewed changes

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

Show a summary per file
File Description
server-common/src/main/java/org/apache/kafka/server/quota/QuotaType.java Adds DISKLESS_CONSOLIDATION_FETCH quota type identifier for metrics/JMX grouping.
server-common/src/main/java/org/apache/kafka/server/config/ServerConfigs.java Introduces the new broker config key/default/doc and registers it in the config definition.
core/src/main/scala/kafka/server/KafkaConfig.scala Exposes the new rate-limit config via KafkaConfig.
core/src/main/scala/kafka/server/ReplicaManager.scala Creates a dedicated ReplicationQuotaManager for consolidation and wires it into fetcher manager + reconciler.
core/src/main/scala/io/aiven/inkless/consolidation/ConsolidationReconciler.scala Marks consolidation topics as throttled so bytes are recorded against the dedicated quota.
core/src/test/scala/io/aiven/inkless/consolidation/ConsolidationReconcilerTest.scala Updates test construction for the new reconciler dependency.
core/src/test/scala/io/aiven/inkless/consolidation/ConsolidationQuotaManagerTest.scala Adds coverage for quota exceed/recovery, independence from follower quota, metrics exposure, and dynamic quota updates.

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

Comment thread core/src/main/scala/io/aiven/inkless/consolidation/ConsolidationReconciler.scala Outdated

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 7 out of 7 changed files in this pull request and generated 2 comments.

Comment thread core/src/main/scala/kafka/server/ReplicaManager.scala Outdated
Comment thread core/src/main/scala/kafka/server/ReplicaManager.scala

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 7 out of 7 changed files in this pull request and generated no new comments.

@jeqo
jeqo requested a review from viktorsomogyi June 10, 2026 08:53
@viktorsomogyi
viktorsomogyi merged commit d62062d into main Jun 10, 2026
9 checks passed
@viktorsomogyi
viktorsomogyi deleted the jeqo/ts-consolidation-rate-limit branch June 10, 2026 09:29
jeqo added a commit that referenced this pull request Jun 10, 2026
…45] (#636)

Introduce a separate ReplicationQuotaManager for consolidation fetchers, decoupled from the follower replication quota. This allows operators to cap object-storage read bandwidth (bytes/sec) without affecting regular replication.

Key changes:
- Add DISKLESS_CONSOLIDATION_FETCH QuotaType (JMX: DisklessConsolidationFetch)
- Add diskless.consolidation.fetch.rate.limit.bytes.per.second config
- Wire dedicated quota manager via ConsolidationReconciler (marks topics throttled on partition add, ensuring bytes are recorded to the sensor)
- Zip consolidationQuotaManager into fetcher manager creation (no silent fallback to shared follower quota)

Config lives in ServerConfigs (not InklessConfig) because:
- It is a broker-level config accessed through KafkaConfig, same layer as num.replica.fetchers and leader.replication.throttled.rate
- It uses the diskless.consolidation.* namespace alongside the existing diskless.remote.storage.consolidation.enable config
- InklessConfig is for storage module internals (fetch pools, cache, upload) consumed by SharedState/Reader/Writer, not for fetcher-layer wiring

---------

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

Introduce a separate ReplicationQuotaManager for consolidation fetchers, decoupled from the follower replication quota. This allows operators to cap object-storage read bandwidth (bytes/sec) without affecting regular replication.

Key changes:
- Add DISKLESS_CONSOLIDATION_FETCH QuotaType (JMX: DisklessConsolidationFetch)
- Add diskless.consolidation.fetch.rate.limit.bytes.per.second config
- Wire dedicated quota manager via ConsolidationReconciler (marks topics throttled on partition add, ensuring bytes are recorded to the sensor)
- Zip consolidationQuotaManager into fetcher manager creation (no silent fallback to shared follower quota)

Config lives in ServerConfigs (not InklessConfig) because:
- It is a broker-level config accessed through KafkaConfig, same layer as num.replica.fetchers and leader.replication.throttled.rate
- It uses the diskless.consolidation.* namespace alongside the existing diskless.remote.storage.consolidation.enable config
- InklessConfig is for storage module internals (fetch pools, cache, upload) consumed by SharedState/Reader/Writer, not for fetcher-layer wiring

---------

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