Skip to content

refactor(server): prepare geo code for the deterministic simulator - #5056

Open
krishvishal wants to merge 8 commits into
masterfrom
sim-geo-dc
Open

krishvishal wants to merge 8 commits into
masterfrom
sim-geo-dc

Conversation

@krishvishal

@krishvishal krishvishal commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Rationale

Geo topics replicate between two clusters through their object store buckets. A failover bug in this path shows only under crashes, store faults and clock skew, and a failed run must replay from its seed. The deterministic simulator gives this. But the geo code reads the system clock and runs its store reads on compio timers, so a simulated run of it does not repeat. This PR prepares the server code for the simulator and changes no behavior in production. The simulator changes come in a second PR, stacked on this one.

What changed?

Before, the geo code in shard and the store reads in partitions read Instant::now, SystemTime::now and IggyTimestamp::now. They also timed and spawned their work on compio directly, so a simulated run mixed virtual time with real time. Now they read the clock of the shard's message bus (realtime_micros, monotonic_now). The store reads run their timeouts, backoff and index fetches on a ReadRuntime that the shard gives them. IggyMessageBus reads the system clock and runs on compio, so production timing does not change.

@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 96.34340% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.62%. Comparing base (b179e96) to head (1af1100).

Files with missing lines Patch % Lines
core/partitions/src/iggy_index_reader.rs 90.38% 1 Missing and 4 partials ⚠️
core/server/src/tiered_storage.rs 89.58% 5 Missing ⚠️
core/shard/src/peer_manifest_follows.rs 20.00% 4 Missing ⚠️
core/shard/src/peers.rs 90.00% 3 Missing ⚠️
core/partitions/src/remote_segments.rs 96.29% 2 Missing ⚠️
core/server/src/geo_peers.rs 95.34% 0 Missing and 2 partials ⚠️
core/partitions/src/iggy_partition.rs 90.90% 1 Missing ⚠️
core/partitions/src/index_files.rs 96.96% 1 Missing ⚠️

❌ Your patch check has failed because the patch coverage (19.13%) 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              @@
##             master    #5056      +/-   ##
============================================
- Coverage     92.26%   91.62%   -0.64%     
+ Complexity     4367     4364       -3     
============================================
  Files          1592     1593       +1     
  Lines        436807   422044   -14763     
  Branches     365039   350277   -14762     
============================================
- Hits         403019   386717   -16302     
- Misses        28172    29308    +1136     
- Partials       5616     6019     +403     
Components Coverage Δ
Rust Core 92.83% <96.34%> (-0.73%) ⬇️
Java SDK 81.01% <ø> (-0.03%) ⬇️
C# SDK 86.33% <ø> (-0.07%) ⬇️
Python SDK 85.41% <ø> (+0.01%) ⬆️
PHP SDK 90.42% <ø> (ø)
Node SDK 97.26% <ø> (ø)
Go SDK 73.86% <ø> (+0.18%) ⬆️
C++ SDK 85.44% <ø> (ø)
Files with missing lines Coverage Δ
core/common/src/utils/timestamp.rs 77.22% <100.00%> (+0.69%) ⬆️
core/partitions/src/fresh_sweep.rs 99.21% <100.00%> (+0.01%) ⬆️
core/partitions/src/lib.rs 58.82% <ø> (ø)
core/partitions/src/peer_log.rs 98.39% <100.00%> (-0.21%) ⬇️
core/partitions/src/placed_read.rs 94.24% <100.00%> (+0.15%) ⬆️
core/partitions/src/poll_plan.rs 95.84% <100.00%> (-0.02%) ⬇️
core/partitions/src/read_runtime.rs 100.00% <100.00%> (ø)
core/partitions/src/remote_blocks.rs 97.94% <100.00%> (+0.08%) ⬆️
core/server/src/geo_passes.rs 100.00% <100.00%> (ø)
core/server/src/geo_topics.rs 87.68% <100.00%> (+0.28%) ⬆️
... and 27 more

... and 198 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.

@spetz spetz 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.

Please fix the fresh-sweep panic on valid filesystem timestamps and the obsolete indexes left behind by fileless shadows. The inline comments also cover the cost of memory index reads.

Comment thread core/shard/src/fresh_sweeps.rs Resolved
Comment thread core/partitions/src/iggy_partition.rs Resolved
Comment thread core/server/src/geo_peers.rs Resolved
@github-actions github-actions Bot added S-waiting-on-author PR is waiting on author response and removed S-waiting-on-review PR is waiting on a reviewer labels Nov 25, 2026
krishvishal and others added 8 commits November 28, 2026 22:04
Production buses still read the system clock, so only the simulator sees a change.
Boot and the simulator give a shard its tier service, readiness and writers with the same function.
The reconciler and the simulator call one GeoPasses with the time of their own clock.
Polls of remote and peer segments write, open and remove their .index files through IndexFiles, whose default is the local disk.
Boot and the simulator hand a shard its peer stores with one function, and the simulator builds shadow partitions with peer_log_of.
HashMaps ordered the manifest reads and the rewrite passes differently per process, so a simulated geo run did not replay from its seed.
Simulated partitions keep no files, and their polls answered empty instead of reading the peer's store.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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

S-waiting-on-author PR is waiting on author response

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants