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

PushData only pushed to active followers. #584

Merged
merged 2 commits into from
Nov 13, 2024

Conversation

xiaoxichen
Copy link
Collaborator

If a follower is lagging too far, do not flood it with data from new IOs (new rreq, new LSNs) , reserve the capability for catching up, that follower can request data via FetchData.

@codecov-commenter
Copy link

codecov-commenter commented Nov 7, 2024

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

Codecov Report

Attention: Patch coverage is 80.00000% with 5 lines in your changes missing coverage. Please review.

Project coverage is 67.23%. Comparing base (1a0cef8) to head (ae7bc5f).
Report is 88 commits behind head on master.

Files with missing lines Patch % Lines
src/lib/replication/repl_dev/raft_repl_dev.cpp 80.00% 2 Missing and 3 partials ⚠️

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

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #584       +/-   ##
===========================================
+ Coverage   56.51%   67.23%   +10.72%     
===========================================
  Files         108      109        +1     
  Lines       10300    10728      +428     
  Branches     1402     1468       +66     
===========================================
+ Hits         5821     7213     +1392     
+ Misses       3894     2817     -1077     
- Partials      585      698      +113     

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

JacksonYao287
JacksonYao287 previously approved these changes Nov 8, 2024
Copy link
Contributor

@JacksonYao287 JacksonYao287 left a comment

Choose a reason for hiding this comment

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

LGTM

if (sisl_likely(res.value())) {
auto r = res.value();
if (r.hasError()) {
// Just logging PushData error, no action is needed as follower can try by fetchData.
Copy link
Contributor

Choose a reason for hiding this comment

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

this part makes sense

@@ -264,6 +264,9 @@ table Consensus {

// Log difference to determine if the follower is in resync mode
resync_log_idx_threshold: int64 = 100;

// Log difference from leader's point of view, to determine if the follower is laggy.
Copy link
Contributor

Choose a reason for hiding this comment

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

... to determine if the follower is laggy and if so, leader will stop pushing data until it drops under this threshold.

auto repl_status = get_replication_status();
std::set< replica_id_t > res;
auto my_committed_idx = m_commit_upto_lsn.load();
uint64_t lagThreshold = my_committed_idx > HS_DYNAMIC_CONFIG(consensus.laggy_threshold)
Copy link
Contributor

@yamingk yamingk Nov 12, 2024

Choose a reason for hiding this comment

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

nit: since HomeStore uses my_local_var name format, can we change to lag_threshold?

after reading through the logic, probably should rename to "least_active_repl_idx", since this var is actually not a threshold, but a min idx for a member to be "active", right?

yamingk
yamingk previously approved these changes Nov 12, 2024
@xiaoxichen xiaoxichen dismissed stale reviews from yamingk and JacksonYao287 via 21bbbe2 November 12, 2024 15:23
If a follower is lagging too far, do not flood it with data
from new IOs (new rreq, new LSNs) ,  reserve the capability
for catching up,  that follower can request data via FetchData.

Signed-off-by: Xiaoxi Chen <[email protected]>
Signed-off-by: Xiaoxi Chen <[email protected]>
@xiaoxichen xiaoxichen merged commit 8452fc5 into eBay:master Nov 13, 2024
21 checks passed
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