-
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
Implement get_next_batch_size_hint_in_bytes() #599
Implement get_next_batch_size_hint_in_bytes() #599
Conversation
8425adf
to
497356b
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 #599 +/- ##
==========================================
+ Coverage 56.51% 66.45% +9.93%
==========================================
Files 108 109 +1
Lines 10300 10829 +529
Branches 1402 1479 +77
==========================================
+ Hits 5821 7196 +1375
+ Misses 3894 2932 -962
- Partials 585 701 +116 ☔ View full report in Codecov by Sentry. |
d5bef77
to
853ac2e
Compare
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 tcp-like traffic(log sending) control looks good to me
78afe42
to
8fa4f6b
Compare
thanks @JacksonYao287 , addressed. |
we use the `byte` as `cnt` as of now. Also update the log_entries_ext() which will be called on leader, if hint < 0 means follower want nothing, return an empty vector so that an empty append_entries_req will be sent, to carry the commit_index update and trigger the follower to commit. if hint > 0, respect the cnt that the follower want, this is useful when two logs within same batch has dependency, we can exclude the dependent one. if hint = 0 means control by leader. Signed-off-by: Xiaoxi Chen <[email protected]>
8fa4f6b
to
bdd0981
Compare
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.
// limit to original end | ||
new_end = std::min(new_end, end); | ||
} | ||
DEBUG_ASSERT(new_end <= end, "new end {} should be <= original end {}", new_end, end); |
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: DEBUG_ASSERT_LE(new_ned, end);
and let macro to print it is value when assert fail
// We are rejecting this log entry, meaning we can accept previous log entries. | ||
// If there is nothing we can accept(i==0), that maens we are waiting for commit | ||
// of previous lsn, set it to 1 in this case. | ||
m_state_machine->reset_next_batch_size_hint(std::max(1ul, i)); |
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.
Can you help me understand if we are setting 1 here, how can we get batch_size_hint_cnt
to be set as -1 at HomeRaftLogStore::log_entries_ext
, so that we can apply empty append entries and only send commit to the follower?
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.
we use the
byte
ascnt
as of now.Also update the log_entries_ext() which will be called on leader,
if hint < 0 means follower want nothing, return an empty vector so that an empty append_entries_req will be sent, to carry the commit_index update and trigger the follower to commit.
if hint > 0, respect the cnt that the follower want, this is useful when two logs within same batch has dependency, we can exclude the dependent one.
if hint = 0 means control by leader.