Skip to content

feat(inkless:consolidation): separate ConsolidationFetchBytesInPerSec from replication metric [KC-276] - #723

Merged
giuseppelillo merged 1 commit into
mainfrom
jeqo/kc-276-consolidation-fetch-metrics
Jul 29, 2026
Merged

feat(inkless:consolidation): separate ConsolidationFetchBytesInPerSec from replication metric [KC-276]#723
giuseppelillo merged 1 commit into
mainfrom
jeqo/kc-276-consolidation-fetch-metrics

Conversation

@jeqo

@jeqo jeqo commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

ReplicationBytesInPerSec previously summed inter-broker replication AND consolidation fetcher appends, since both go through the AbstractFetcherThread processPartitionData path. That conflation made the metric meaningless on consolidation-heavy brokers and required operators to subtract the consolidation throughput to recover the inter-broker number.

Add a shouldRecordReplicationBytesIn hook in ReplicaFetcherThread (default true) and override to false in ConsolidationFetcherThread. Add a new ConsolidationFetchBytesInPerSec meter on ReplicaManager, marked from ConsolidationFetcherThread.processPartitionData when validBytes > 0.

Effect on existing dashboards: ReplicationBytesInPerSec on consolidation brokers will drop by the consolidation throughput (now reported separately). This is the corrected baseline.

KC-276

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 fixes a metrics accounting issue where consolidation fetcher throughput was being included in the inter-broker ReplicationBytesInPerSec meter (because both paths share ReplicaFetcherThread.processPartitionData). It introduces a dedicated consolidation meter so replication dashboards on consolidation-heavy brokers reflect true inter-broker replication traffic.

Changes:

  • Add a shouldRecordReplicationBytesIn hook in ReplicaFetcherThread (default true) and disable it in ConsolidationFetcherThread to prevent consolidation traffic from updating ReplicationBytesInPerSec.
  • Introduce a new broker-level meter ConsolidationFetchBytesInPerSec on ReplicaManager, marked from ConsolidationFetcherThread using LogAppendInfo.validBytes.
  • Add tests ensuring consolidation bytes are recorded and replication bytes are not recorded by consolidation fetchers.

Reviewed changes

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

File Description
core/src/test/scala/io/aiven/inkless/consolidation/ConsolidationFetcherThreadTest.scala Adds coverage for the new consolidation bytes meter and ensures replication bytes aren’t updated by consolidation fetchers.
core/src/main/scala/kafka/server/ReplicaManager.scala Defines and registers the new ConsolidationFetchBytesInPerSec meter and exposes a recording method.
core/src/main/scala/kafka/server/ReplicaFetcherThread.scala Adds the shouldRecordReplicationBytesIn hook and gates replication-bytes metering behind it.
core/src/main/scala/io/aiven/inkless/consolidation/ConsolidationFetcherThread.scala Disables replication-bytes metering and records consolidation bytes based on append validBytes.

Comment thread core/src/main/scala/kafka/server/ReplicaFetcherThread.scala Outdated
@jeqo
jeqo force-pushed the jeqo/kc-276-consolidation-fetch-metrics branch from 9452619 to 62144ad Compare July 28, 2026 13:58
… from replication metric

ReplicationBytesInPerSec previously summed inter-broker replication AND
consolidation fetcher appends, since both go through the AbstractFetcherThread
processPartitionData path. That conflation made the metric meaningless on
consolidation-heavy brokers and required operators to subtract the
consolidation throughput to recover the inter-broker number.

Add a shouldRecordReplicationBytesIn hook in ReplicaFetcherThread (default
true) and override to false in ConsolidationFetcherThread. Add a new
ConsolidationFetchBytesInPerSec meter on ReplicaManager, marked from
ConsolidationFetcherThread.processPartitionData when validBytes > 0.

Effect on existing dashboards: ReplicationBytesInPerSec on consolidation
brokers will drop by the consolidation throughput (now reported separately).
This is the corrected baseline.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@jeqo
jeqo force-pushed the jeqo/kc-276-consolidation-fetch-metrics branch from 62144ad to be1314e Compare July 28, 2026 15:49
@jeqo
jeqo requested a review from Copilot July 28, 2026 16:21

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

@jeqo
jeqo marked this pull request as ready for review July 29, 2026 07:54
@giuseppelillo
giuseppelillo merged commit 7a18857 into main Jul 29, 2026
8 checks passed
@giuseppelillo
giuseppelillo deleted the jeqo/kc-276-consolidation-fetch-metrics branch July 29, 2026 12:58
giuseppelillo pushed a commit that referenced this pull request Jul 29, 2026
… from replication metric (#723)

ReplicationBytesInPerSec previously summed inter-broker replication AND
consolidation fetcher appends, since both go through the AbstractFetcherThread
processPartitionData path. That conflation made the metric meaningless on
consolidation-heavy brokers and required operators to subtract the
consolidation throughput to recover the inter-broker number.

Add a shouldRecordReplicationBytesIn hook in ReplicaFetcherThread (default
true) and override to false in ConsolidationFetcherThread. Add a new
ConsolidationFetchBytesInPerSec meter on ReplicaManager, marked from
ConsolidationFetcherThread.processPartitionData when validBytes > 0.

Effect on existing dashboards: ReplicationBytesInPerSec on consolidation
brokers will drop by the consolidation throughput (now reported separately).
This is the corrected baseline.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
giuseppelillo pushed a commit that referenced this pull request Jul 30, 2026
… from replication metric (#723)

ReplicationBytesInPerSec previously summed inter-broker replication AND
consolidation fetcher appends, since both go through the AbstractFetcherThread
processPartitionData path. That conflation made the metric meaningless on
consolidation-heavy brokers and required operators to subtract the
consolidation throughput to recover the inter-broker number.

Add a shouldRecordReplicationBytesIn hook in ReplicaFetcherThread (default
true) and override to false in ConsolidationFetcherThread. Add a new
ConsolidationFetchBytesInPerSec meter on ReplicaManager, marked from
ConsolidationFetcherThread.processPartitionData when validBytes > 0.

Effect on existing dashboards: ReplicationBytesInPerSec on consolidation
brokers will drop by the consolidation throughput (now reported separately).
This is the corrected baseline.

Co-authored-by: Claude Opus 4.7 <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