Skip to content

docs: fetch read coalescing (DOC-2386)#1821

Open
Feediver1 wants to merge 8 commits into
betafrom
DOC-2386-fetch-read-coalescing
Open

docs: fetch read coalescing (DOC-2386)#1821
Feediver1 wants to merge 8 commits into
betafrom
DOC-2386-fetch-read-coalescing

Conversation

@Feediver1

@Feediver1 Feediver1 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Resolves https://redpandadata.atlassian.net/browse/DOC-2386

Adds documentation for fetch read coalescing, the opt-in per-shard fetch read coalescer new in 26.2 that removes redundant read CPU and fetch-response memory under high consumer fan-out.

Changes

  • New page modules/develop/pages/consume-data/fetch-read-coalescing.adoc: contextualized intro (the N×→1× redundancy story and an explicit use-when), how it works (coalescing key, the ready-hit/in-flight-hit/miss outcomes, weak retention, per-shard scope), enable procedure (kafka_fetch_read_coalescing_enabled, live toggle, ~0.5 MB/shard cache), an Evaluate coalescing effectiveness section with the four vectorized_kafka_fetch_read_coalescer_* counters and the hit-ratio formula for judging workload fit, and limitations.
  • Nav: entry after Follower Fetching under Consume Data.
  • follower-fetching.adoc: an ifndef::env-cloud[]-gated TIP cross-linking the new page (that page is single-sourced to cloud-docs; the new page is docs-only, so the cloud build never parses the xref).

All content is sourced from the engineering TOI: engineering/core/toi/v26.2/2026-07-21-fetch-read-coalescing.md (Brandon Allard, SME), and verified against the implementation PR redpanda#31010 (merged to dev 2026-07-13, 26.2-only, no backports): property description, coalescing-key definition, obligatory-vs-strict duplicate-read caveat, and weak-retention behavior all match the source.

Single-sourcing for Redpanda Cloud (added after SME input)

Per Brandon Allard: fetch read coalescing can be enabled on BYOC and Dedicated clusters, so the page is now single-sourced:

  • // tag::single-source[] wraps the page; companion stub PR: cloud-docs#645 (draft — must merge only after this content reaches docs main at 26.2 promotion, since cloud-docs consumes streaming from main).
  • Cloud build gets: an availability line (BYOC/Dedicated), the enable procedure plus a gated pointer to cloud's cluster-configuration page, and the limitations.
  • The Evaluate coalescing effectiveness section is ifndef::env-cloud[]-gated: Cloud exposes only public_metrics to customers, and the coalescer counters are internal vectorized_* metrics. (Worth a Brandon confirmation that there's no Cloud-side visibility planned.)
  • The cross-link TIP on follower-fetching.adoc stays ifndef::env-cloud[]-gated for now; un-gating it is a follow-up after the cloud stub merges (otherwise the cloud build gets an xref to a page that doesn't exist there yet).

Review notes

  • kafka_fetch_read_coalescing_enabled is not yet in the generated cluster-properties partial (arrives with the 26.2 property regen), so the page mentions it in code font without an xref; the link can be added after regen.
  • The four coalescer metrics arrive via the 26.2 internal-metrics regen.
  • Deliberately no version callout in prose (the page ships in the 26.2 docs version).
  • Per the ticket chain: findings from this write-up inform the final disposition of DOC-2129 (Cloud Topics tuning material).

🤖 Generated with Claude Code

Preview pages

New consume-data page for the 26.2 opt-in per-shard fetch read
coalescer: concept, enable procedure, hit-ratio evaluation guidance,
and limitations. Adds a nav entry and an env-gated cross-link TIP on
the follower-fetching page (single-sourced; cloud build unaffected).

Sourced from the engineering TOI (cupboard
engineering/core/toi/v26.2/2026-07-21-fetch-read-coalescing.md).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Feediver1
Feediver1 requested a review from a team as a code owner July 22, 2026 17:17
@netlify

netlify Bot commented Jul 22, 2026

Copy link
Copy Markdown

Deploy Preview for redpanda-docs-preview ready!

Name Link
🔨 Latest commit 4b8a22a
🔍 Latest deploy log https://app.netlify.com/projects/redpanda-docs-preview/deploys/6a62780609d53c0009e2011c
😎 Deploy Preview https://deploy-preview-1821--redpanda-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: aa24f0c3-288a-46d7-85a4-3372439645ff

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch DOC-2386-fetch-read-coalescing

Comment @coderabbitai help to get the list of available commands.

Comment thread modules/develop/pages/consume-data/fetch-read-coalescing.adoc Outdated
Comment thread modules/develop/pages/consume-data/fetch-read-coalescing.adoc
Reword the enable guidance (disabled by default, little-to-no benefit)
and add an intro sentence to Limitations.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Per SME (Brandon Allard), the feature can be enabled on BYOC and
Dedicated clusters. Wrap the page in a single-source tag with env
gating: cloud gets an availability line, the enable procedure with a
pointer to cloud cluster configuration, and the limitations; the
internal-metrics evaluation section is excluded from the cloud build
(only public_metrics is customer-visible in Cloud). Companion stub:
cloud-docs#645.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

When many consumers fetch the same partition at the same offset concurrently (high read fan-out), the broker does redundant work: each fetch performs its own log read, its own serialization, and allocates its own copy of the response bytes. With a fan-out of N consumers, that is roughly N times the read CPU and N times the fetch-response memory for byte-identical output.

Fetch read coalescing removes that redundancy. The broker reads and serializes each unique read once, and shares the single result with every concurrent (and eligible back-to-back) consumer of the same data: one read, one serialization, one buffer, fanned out to all requesters. Under aligned fan-out, read CPU and fetch-response memory drop from roughly N times to one.

@ballard26 ballard26 Jul 23, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Not sure what Under aligned fan-out means in the last sentence here; there is no reference/mention to what it means for fanout to be aligned prior to this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fair catch — "aligned fan-out" was shorthand this page invented and never defined. It was meant to describe the ideal case where the concurrent fetches are duplicates of each other: same partition, same offset, same fetch settings, so every fetch can share one read. Fixed in 8324dec by spelling that out instead of naming it: the sentence now reads "When all N consumers fetch the same partition at the same offset with the same fetch settings, read CPU and fetch-response memory drop from roughly N times to one." Also replaced the matching "misaligned or low fan-out" phrasing later on the page with plain language (consumers at different offsets, or few consumers per partition).

ifdef::env-cloud[]
Fetch read coalescing is available on BYOC and Dedicated clusters.

Fetch read coalescing is disabled by default. Enable it when many consumers tail the same partitions with the same fetch settings, for example fan-out delivery of one stream to many downstream applications. Workloads with misaligned or low fan-out see little-to-no benefit and should leave it disabled.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Note that cloud users can't enable this themselves AFAIK. Maybe it is something they should be able to do though. Let me look into whitelisting the config option for user control.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I will update to make this clear. If you end up whitelisting this option for user control before we release, please let me know asap. thx.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Will do

Fetch read coalescing is disabled by default. Enable it when many consumers tail the same partitions with the same fetch settings, for example fan-out delivery of one stream to many downstream applications. Workloads with misaligned or low fan-out see little-to-no benefit and should leave it disabled. See <<Evaluate coalescing effectiveness>> for how to measure whether it helps your workload.
endif::[]

== How fetch read coalescing works

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do we normally give in-depth details on how a particular feature is implemented in our docs?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We do, or at least that is the goal. This is now a standard part of the doc template we feed to Claude, and it creates a consistent experience for users regardless of what feature they are reading about. We found that users wanted/needed more context about features--what is this? What does it do? How do I use it? When should I use it? And how does it work? Of course, we try to keep it fairly high-level.

Are you thinking that this material should not be in the doc?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It's fine as-is, my only thought is that the way the feature is implement is likely to change more frequently than the intention/goal of the feature. So its something that could become stale in future updates and you folks aren't pinged for any changes outside of src/v/config AFAIK.

* *Obligatory and strict reads are grouped apart.* A single partition and offset fetched both ways at the same time incurs one duplicate read by design.
* *Retention is best-effort.* Completed results are only reusable by later readers while a fetch still references them; the coalescer never keeps a result alive on its own. The reliable savings are on genuinely concurrent readers of the same data, and back-to-back reuse is opportunistic.
* *Per-shard scope.* Coalescing collapses only the fan-out that lands on the same shard. Where consumers are spread across replicas and shards, for example with follower fetching, each shard coalesces the fan-out local to it.
* *It is a de-duplication mechanism, not a throughput mechanism.* Coalescing reduces read CPU and fetch-response memory; it does not change where reads land or reduce the total volume of unique reads.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Not sure if this last point is entirely accurate or needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

K--I'll remove it.

@ballard26

Copy link
Copy Markdown

In addition to my other comments it's likely worth making a note somewhere that fetch coalescing should only be enabled for high fanout workloads. Enabling it for workloads with 1:1 or 1:2 fanout will likely result in higher reactor util due to the overhead the de-duplication logic introduces.

The term was invented by this page and never defined; spell out the
condition instead (same partition, same offset, same fetch settings).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment thread modules/develop/pages/consume-data/fetch-read-coalescing.adoc Outdated
Feediver1 and others added 3 commits July 23, 2026 13:16
Per ballard26's review: kafka_fetch_read_coalescing_enabled is not
whitelisted for user control in Redpanda Cloud. Gate the rpk procedure
to Self-Managed and route cloud readers to Redpanda Support. Revert to
self-serve wording if the property is whitelisted before release.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Per ballard26: the de-duplication logic runs on every fetch read, so
1:1 or 1:2 fan-out likely increases reactor utilization. Strengthen
the enable guidance in both env variants and add a limitations bullet.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Feediver1

Copy link
Copy Markdown
Contributor Author

Added in 66eed08 — and worth being loud about, since the page previously undersold this as "little-to-no benefit": the enable guidance in both the Self-Managed and Cloud variants now says to enable/request coalescing only for high fan-out workloads because at low fan-out (one or two consumers per partition) the de-duplication overhead can increase reactor utilization, and there's a new Limitations bullet making the same point where readers check before enabling.

@ballard26 ballard26 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

Per leadership decision: add the enterprise-license NOTE and a license
prerequisite to the page (Self-Managed only; Cloud portions unchanged),
and list the feature in the Enterprise features table.

Co-Authored-By: Claude Fable 5 <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.

2 participants