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

Track timestamp of each state in repl_dev_ctx. #514

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xiaoxichen
Copy link
Collaborator

With this we can easily get time diff of each given state, avoid doing the calculation/analysis from grep of logs.

@codecov-commenter
Copy link

codecov-commenter commented Aug 20, 2024

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

Codecov Report

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

Project coverage is 68.22%. Comparing base (1a0cef8) to head (05e7165).
Report is 56 commits behind head on master.

Files with missing lines Patch % Lines
src/lib/replication/repl_dev/common.cpp 50.00% 5 Missing ⚠️

❗ 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.
📢 Have feedback on the report? Share it here.

@@ -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();
Copy link
Contributor

Choose a reason for hiding this comment

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

is this still needed?

Copy link
Collaborator Author

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);
Copy link
Contributor

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?

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 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]>
@zhiteng
Copy link

zhiteng commented Sep 28, 2024

Do we still want this change? I'm cleaning stale/idle PRs.

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