-
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
Track timestamp of each state in repl_dev_ctx. #514
base: master
Are you sure you want to change the base?
Conversation
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 #514 +/- ##
===========================================
+ Coverage 56.51% 68.22% +11.71%
===========================================
Files 108 109 +1
Lines 10300 10439 +139
Branches 1402 1400 -2
===========================================
+ Hits 5821 7122 +1301
+ Misses 3894 2642 -1252
- Partials 585 675 +90 ☔ View full report in Codecov by Sentry. |
@@ -222,8 +222,6 @@ void RaftStateMachine::unlink_lsn_to_req(int64_t lsn) { | |||
void RaftStateMachine::link_lsn_to_req(repl_req_ptr_t rreq, int64_t lsn) { | |||
rreq->set_lsn(lsn); | |||
rreq->add_state(repl_req_state_t::LOG_RECEIVED); | |||
// reset the rreq created_at time to now https://github.com/eBay/HomeStore/issues/506 | |||
rreq->set_created_time(); |
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.
is this still needed?
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.
no as I changed the is_expired()
implementation.
@@ -199,7 +212,7 @@ std::string repl_req_ctx::to_compact_string() const { | |||
} | |||
|
|||
bool repl_req_ctx::is_expired() const { | |||
return get_elapsed_time_sec(m_start_time) > HS_DYNAMIC_CONFIG(consensus.repl_req_timeout_sec); | |||
return time_from(repl_req_state_t::LOG_RECEIVED) > HS_DYNAMIC_CONFIG(consensus.repl_req_timeout_sec); |
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.
if log received, before follower received the data (rreq will also be created), originator is gone, we should also clean up the rreqs, right?
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.
yes right now (the PR) is trying to be compatible with original implementation for is_expired
, mainly to bring in all the timestamp we have as a foundation of next step
I think we discussed the GC stuff a bit today and that need a seperate design, we can visit that later.
With this we can easily get time diff of each given state, avoid doing the calculation/analysis from grep of logs. Signed-off-by: Xiaoxi Chen <[email protected]>
Do we still want this change? I'm cleaning stale/idle PRs. |
With this we can easily get time diff of each given state, avoid doing the calculation/analysis from grep of logs.