Skip to content

feat(server): let a shadow topic inherit its origin's read cache options - #5053

Open
numinnex wants to merge 4 commits into
read_cache_topic_optionsfrom
shadow_read_cache_options
Open

numinnex wants to merge 4 commits into
read_cache_topic_optionsfrom
shadow_read_cache_options

Conversation

@numinnex

@numinnex numinnex commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

A geo topic can set its read cache size and readahead, but the shadow
of that topic in another datacenter could not. No client creates or
updates a shadow, so it read with the server settings of its own
cluster, whatever its origin had chosen.

The origin now publishes the two values in the topic object. The
object gets a new version for that, with a bit per value, since zero
is a value. A topic that sets neither publishes neither. The pass that
keeps topic objects in step with metadata already stores an object
again when its content changes, so an update of the options is
published at once.

The cluster that adopts the topic gives the shadow the published
values. For a shadow it already has, it compares what the object holds
with what the shadow stores each time it reads the object again, and
proposes a new kind of the shadow operation when they differ. That
operation can also remove a value, so a shadow whose origin unsets one
falls back to its own cluster's setting. An update on the origin
reaches the shadow within about half a minute, with no restart on
either side.

A value that does not fit the reading cluster is stored as published
and capped where it is applied. A peer that cannot be read, or that is
another cluster than the shadow came from, changes nothing.

No release has shipped geo topics, so the old version of the topic
object is no longer read.

A geo topic can set its read cache size and readahead, but the shadow
of that topic in another datacenter could not. No client creates or
updates a shadow, so it read with the server settings of its own
cluster, whatever its origin had chosen.

The origin now publishes the two values in the topic object. The object
gets a new version for that, with a bit per value, since zero is a
value. A topic that sets neither publishes neither. The pass that keeps
topic objects in step with metadata already stores an object again when
its content changes, so an update of the options is published at once.

The cluster that adopts the topic gives the shadow the published
values. For a shadow it already has, it compares what the object holds
with what the shadow stores each time it reads the object again, and
proposes a new kind of the shadow operation when they differ. That
operation can also remove a value, so a shadow whose origin unsets one
falls back to its own cluster's setting. An update on the origin reaches
the shadow within about half a minute, with no restart on either side.

A value that does not fit the reading cluster is stored as published
and capped where it is applied. A peer that cannot be read, or that is
another cluster than the shadow came from, changes nothing.

No release has shipped geo topics, so the old version of the topic
object is no longer read.
@numinnex numinnex added the breaking:storage On-disk data format change - skips backwards compat CI label Nov 23, 2026
@numinnex
numinnex added this pull request to stack #5048 November 23, 2026 16:12
@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label Nov 23, 2026
@codecov

codecov Bot commented Nov 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.19048% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.27%. Comparing base (faa7d7e) to head (7ddb7e1).

Files with missing lines Patch % Lines
core/metadata/src/stm/shadow.rs 84.78% 9 Missing and 5 partials ⚠️
core/object_store/src/topic.rs 81.08% 2 Missing and 5 partials ⚠️
core/server/src/shadow_topics.rs 91.66% 3 Missing and 2 partials ⚠️
core/partitions/src/remote_blocks.rs 40.00% 3 Missing ⚠️

❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@                      Coverage Diff                       @@
##             read_cache_topic_options    #5053      +/-   ##
==============================================================
- Coverage                       79.31%   79.27%   -0.05%     
- Complexity                       4361     4363       +2     
==============================================================
  Files                            1548     1548              
  Lines                          250405   250613     +208     
  Branches                       178708   178916     +208     
==============================================================
+ Hits                           198616   198678      +62     
- Misses                          45722    45866     +144     
- Partials                         6067     6069       +2     
Components Coverage Δ
Rust Core 76.06% <86.19%> (-0.08%) ⬇️
Java SDK 81.03% <ø> (+0.03%) ⬆️
C# SDK 86.29% <ø> (+0.16%) ⬆️
Python SDK 85.39% <ø> (ø)
PHP SDK 90.42% <ø> (ø)
Node SDK 97.20% <ø> (-0.01%) ⬇️
Go SDK 73.80% <ø> (-0.05%) ⬇️
C++ SDK 85.44% <ø> (ø)
Files with missing lines Coverage Δ
core/server/src/geo_topics.rs 85.32% <100.00%> (+0.58%) ⬆️
core/server/src/origin_recovery.rs 67.41% <100.00%> (-2.29%) ⬇️
core/shard/src/partition_io.rs 82.76% <ø> (-0.81%) ⬇️
core/partitions/src/remote_blocks.rs 89.64% <40.00%> (-0.39%) ⬇️
core/server/src/shadow_topics.rs 77.56% <91.66%> (+1.36%) ⬆️
core/object_store/src/topic.rs 73.12% <81.08%> (+1.36%) ⬆️
core/metadata/src/stm/shadow.rs 79.37% <84.78%> (+0.99%) ⬆️

... and 56 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Master keeps each stream of the catalog behind an Arc and dropped the
shard count from the reconciler test context, so the merge did not
compile. set_read_cache now reads the topic first and changes the
stream through IdSlab::make_mut, as the other shadow writes do, and the
geo topics test builds its context without the removed argument.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking:storage On-disk data format change - skips backwards compat CI S-waiting-on-review PR is waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant