-
Notifications
You must be signed in to change notification settings - Fork 21
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
Conversation
7ff78d3
to
07082de
Compare
Codecov ReportAttention: Patch coverage is
❗ 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. |
There was a problem hiding this 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this part makes sense
src/lib/common/homestore_config.fbs
Outdated
@@ -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. |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
21bbbe2
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]>
21bbbe2
to
ae7bc5f
Compare
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.