-
Notifications
You must be signed in to change notification settings - Fork 24
support handling config rollback and add periodical notfity the lastest committed lsn to upper layer #703
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
support handling config rollback and add periodical notfity the lastest committed lsn to upper layer #703
Conversation
297f29a to
4c45c0a
Compare
327727d to
50b29ba
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 #703 +/- ##
===========================================
+ Coverage 56.51% 66.81% +10.29%
===========================================
Files 108 109 +1
Lines 10300 11511 +1211
Branches 1402 1571 +169
===========================================
+ Hits 5821 7691 +1870
+ Misses 3894 3066 -828
- Partials 585 754 +169 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Besroy
left a comment
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
| /// @param lsn - The log sequence number | ||
| /// | ||
| /// config change will not involve any data write, so the blkids are not passed. | ||
| virtual void on_config_commit(int64_t lsn){ |
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.
Just curious why not set '=0' to ensure that HO implements those functions.
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.
1 if we set it to 0, HO will have to implement this. this means before HO implements this, all the PR in homeobject will hit building failure.
2 some other upper layers(for example ,nublox) probably not care about this signal and this callback. if we make this pure virtual, all the upper layers will have to implement this callback, even if they don`t care about this.
but, yes, we can make it pure virtual, I can change it after homeobject side change is completed so that it will not block any other pr for homeobject
| // keep this variable in case it is needed later | ||
| (void)new_conf; | ||
| (void)new_conf; // use this if we need it in the future | ||
| m_listener->on_config_commit(lsn); |
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.
maybe passing the new_conf as (void *) ?
@yamingk what do you think?
We dont know how the config can be used on upstream without breaking the boundary for HO to understand Raft.
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 we pass this as void*, when we want to use it, we have to convert it to a nuraft type, which will also break the boundary. well, IMO, we can pass it to upstream until we know we definitely need it and how to use it , changes about this will not be too expensive.
|
Just a reminder, |
wow, this is a very nice catch. thanks for pointing out this @yuwmao. basically, from the perspective of nuraft, HS_CTRL_REPLACE/HS_CTRL_DESTROY are both normal(not config) log, so they should be taken into account for this case.
|
|
handle op code in eBay/HomeObject#293 |
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.
Overall, I question whether the effort to ensure every commit calls HO for handling GC in the context of on_commit is more beneficial than simply monitoring get_last_commit_lsn in another thread..
2c66e28 to
5d27dd7
Compare
|
@xiaoxichen thanks for the great idea! I have made this change, pls take a look. now we add notify_committed_lsn in the timer of flushing durable committed lsn, which will periodically notify the upper layer the latest committed lsn. so we change edge trigger to condition trigger on handling no_space_left. thus , we no longer need pause statemachine. |
|
|
||
| /// @brief periodically called to notify the lastest committed lsn to the listener. | ||
| /// | ||
| /// @param lsn - The log sequence number |
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.
Concerning any heavy/blocking operations in the CB as it will block the DC_LSN flushing.
Lets start with putting clear comment here
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.
ok ,will update this PR and add additional comments here
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.
comments updated, ptal
xiaoxichen
left a comment
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.
Though I wish in GC thread model if this thread can be taken care by a global thread (across all ReplDev) in HO.
|
please write a decent commit message when squashing , either now or when merging. |
…he lastest committed lsn to upper layer (eBay#703)
No description provided.