Skip to content

Restart support for craft client tests - #2

Open
raakella1 wants to merge 25 commits into
eBay:dev/v0.xfrom
raakella1:restart_support
Open

raakella1 wants to merge 25 commits into
eBay:dev/v0.xfrom
raakella1:restart_support

Conversation

@raakella1

@raakella1 raakella1 commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

To support test cases where the replicas need to be restarted, add a registry class which stores type erased key value pairs. Any component can store the values in the registry and recover from it in the constructor.

@raakella1 raakella1 changed the title Restart support Restart support for craft client tests Sep 13, 2026

Copilot AI 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.

🟡 Changes recommended

Restart recovery currently retains stale Raft objects, loses essential state across lifecycles, and can incorrectly advance the commit frontier.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds an in-memory registry intended to preserve replica and Raft state across restarts.

Changes:

  • Replaces the singleton replica manager with a type-erased registry.
  • Preserves journals, indexes, Raft logs, configuration, and membership.
  • Refactors Raft/server lifecycle APIs and updates build metadata.
File summaries
File Description
tools/craft_test_driver/cluster.py Adjusts logging configuration.
tools/craft_reference_tcp_srv.cpp Creates and passes the registry.
src/replica_mgr.hpp Removes the former replica manager.
src/replica_mgr.cpp Removes its implementation.
src/registry_mgr.hpp Adds the generic registry.
src/raft/raft_state_manager.hpp Injects registry access.
src/raft/raft_state_manager.cpp Stores Raft state in the registry.
src/raft/raft_state_machine.hpp Adds registry ownership plumbing.
src/raft/raft_service.hpp Refactors Raft service lifecycle.
src/raft/raft_service.cpp Uses registry-backed peers and managers.
src/raft/raft_replica.hpp Adds restart-oriented construction parameters.
src/raft/raft_replica.cpp Restores replica data and membership.
src/net/tcp_server.hpp Exposes registry and Raft options.
src/net/tcp_server.cpp Constructs registry-aware replicas.
src/mem/replica.hpp Makes journal and index shareable.
src/mem/replica.cpp Migrates map access to shared storage.
src/helper.hpp Adds registry-key generation.
conanfile.py Bumps the package version.
CMakeLists.txt Updates targets and source ownership.
Review details
  • Files reviewed: 19/19 changed files
  • Comments generated: 5
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/raft/raft_replica.cpp
Comment thread src/raft/raft_replica.cpp
Comment thread src/raft/raft_replica.cpp Outdated
Comment thread src/raft/raft_service.cpp Outdated
Comment thread tools/craft_reference_tcp_srv.cpp
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