Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support spare replicas in raft test framework #226

Merged
merged 5 commits into from
Nov 15, 2024

Conversation

JacksonYao287
Copy link
Collaborator

@JacksonYao287 JacksonYao287 commented Nov 11, 2024

this PR aims to support spare replicas in raft test framework , which is essential for testing pg move. what`s more, a basic replace_member UT is added

@codecov-commenter
Copy link

codecov-commenter commented Nov 11, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 67.85714% with 9 lines in your changes missing coverage. Please review.

Project coverage is 65.20%. Comparing base (1746bcc) to head (7082539).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ib/homestore_backend/replication_state_machine.cpp 40.00% 4 Missing and 2 partials ⚠️
src/lib/homestore_backend/index_kv.cpp 0.00% 2 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #226      +/-   ##
==========================================
+ Coverage   63.15%   65.20%   +2.04%     
==========================================
  Files          32       32              
  Lines        1900     1911      +11     
  Branches      204      204              
==========================================
+ Hits         1200     1246      +46     
+ Misses        600      561      -39     
- Partials      100      104       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@xiaoxichen xiaoxichen left a comment

Choose a reason for hiding this comment

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

in general LGTm

if (in_member_id == g_helper->my_replica_id()) {
while (!am_i_in_pg(pg_id)) {
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
LOGINFO("new member is waiting to become a member of pg {}", pg_id);
}

wait_for_all(pg_shard_id_vec[pg_id].back() /*the last shard id in this pg*/,
Copy link
Collaborator

Choose a reason for hiding this comment

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

as discussed, this doesnt guarantee to be right once baseline resync is on , it doesnt sync follow the LSN order.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, but for now, we can not do this , since if a member is not leader , it can not get its own commit lsn
see

// replication_status can be empty in follower

and
https://github.com/eBay/nuraft_mesg/blob/a277e8acae561a4b3873337bb179e32817f10b85/src/lib/repl_service_ctx.cpp#L92

will implement a new wait_for_all as soon as we can get commit_lsn at follower
cc @sanebay

Copy link
Collaborator

Choose a reason for hiding this comment

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

OK, it makes sense to add self lsn to repl_service_ctx::get_raft_status().... When I implement this function I didnt realize we have this requirement./

Copy link
Contributor

@sanebay sanebay left a comment

Choose a reason for hiding this comment

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

LGTM

@JacksonYao287 JacksonYao287 merged commit 20d84b4 into eBay:main Nov 15, 2024
26 checks passed
@JacksonYao287 JacksonYao287 deleted the support-spare-replicas branch November 15, 2024 01:32
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.

4 participants