-
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
Flush log store meta when compacting log #633
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 #633 +/- ##
==========================================
+ Coverage 56.51% 66.10% +9.58%
==========================================
Files 108 109 +1
Lines 10300 10986 +686
Branches 1402 1505 +103
==========================================
+ Hits 5821 7262 +1441
+ Misses 3894 3005 -889
- Partials 585 719 +134 ☔ View full report in Codecov by Sentry. |
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. only a minor comment
REPL_STORE_LOG(DEBUG, "Simulating log compaction with delay, delay:{}", delay.get()); | ||
std::this_thread::sleep_for(std::chrono::milliseconds(delay.get())); | ||
} | ||
#endif | ||
m_log_store->truncate(to_store_lsn(compact_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.
IMO, we can change this line to
m_log_store->truncate(to_store_lsn(compact_lsn), false);
this will be enough.
home_raft_log_store will have one seperate logdev, and there will be only one logstore on this logdev.
this line will change in_memory_truncate_only
to false and as result it will trigger logdev truncation, where the metadata of logstore will be updated
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.
Thanks, that make it even simpler!
- apply_snp_resync_data is similar to apply_snapshot in 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.
LGTM
In baseline resync scenario, log truncation won't flush the truncate result immediately(periodically flushed by resource manager), thus if durable_commit_lsn has been flushed but start_lsn of the logstore hasn't been flushed, it will trigger the issue6.
Add a flush meta function in logstore, and manually trigger flush in log truncation.