-
Notifications
You must be signed in to change notification settings - Fork 22
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
Clean up old logs at the beginning of baseline resync. #643
Clean up old logs at the beginning of baseline resync. #643
Conversation
d642083
to
fbc7b9d
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.
my 0.02
The truncate is misleading and as far as we spent effort on removing this part, do not added back, a explicit HomeRaftLogStore::purge_logs()
or HomeRaftLogStore::purge_all_logs()
might have better readability.
Another suggestion is do not do it in save_logical_snp_obj
as it will be occur in every snapshot batch, better to add it to HomeObject::pg_destroy
then call down to repl_dev_::purge()
, in the implementation of RaftReplDev we clean up logs.
fbc7b9d
to
862b4a3
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 #643 +/- ##
==========================================
+ Coverage 56.51% 66.00% +9.49%
==========================================
Files 108 109 +1
Lines 10300 11000 +700
Branches 1402 1506 +104
==========================================
+ Hits 5821 7261 +1440
+ Misses 3894 3022 -872
- Partials 585 717 +132 ☔ View full report in Codecov by Sentry. |
corresponding to eBay/HomeStore#643
Thanks! updated to |
This change is necessary for baseline resync and can be called by the upper layer to purge existing logs, which resolves the following issue: If a follower restarts during baseline resync, it will replay the remaining logs first. However, shard info has already been cleared at the beginning of resync (from the HO side), making it impossible to retrieve shard info while replaying logs, which results in errors.
862b4a3
to
362387a
Compare
Thinking about moving the LGTM |
Are you suggesting that we perform both log cleaning and chunk resetting within the Would it be better if we added a purge_hs_resources method at the HO level, which would encompass both the purge of repl_dev and the reset of the chunk? |
Yes you are right...lets merge this as is |
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
corresponding to eBay/HomeStore#643
corresponding to eBay/HomeStore#643
corresponding to eBay/HomeStore#643
corresponding to eBay/HomeStore#643
If the follower restarts during baseline resync, it will replay remaining logs first. However, we have already cleared shard info at the beginning of resync, so we cannot get shard while replaying logs, which will raise errors.
This change clean up old logs in log store at the beginning of baseline resync to avoid this situation.