-
Notifications
You must be signed in to change notification settings - Fork 1.1k
chore: bring back partial sync #5182
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
Conversation
Signed-off-by: kostas <kostas@dragonflydb.io>
src/server/dflycmd.cc
Outdated
|
|
||
| string eof_token; | ||
| std::string_view sync_type{"FULL"}; | ||
| bool partial_sync = false; |
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.
we can check again the sync_type also but I like the bool
| error_code Journal::Close() { | ||
| VLOG(1) << "Journal::Close"; | ||
|
|
||
| if (!journal_slice.IsOpen()) { |
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.
redundant after we call journal_slice.Init once. Won't make any difference either if it's not open
|
@adiholden I just commented in the code old code + tests I will follow up with another PR with tests |
src/server/dflycmd.cc
Outdated
|
|
||
| if (IsLSNDiffBellowThreshold(data.value().last_journal_LSNs, lsn_vec)) { | ||
| sync_type = "PARTIAL"; | ||
| partial_sync = true; |
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.
please rebase main branch this code is not up to date
src/server/dflycmd.cc
Outdated
|
|
||
| sf_->journal()->StartInThread(); | ||
|
|
||
| if (!partial_sync && seqid.has_value()) { |
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.
this condition should be else if
becuase we iether get seqid or last_master_id and last_master_lsn
So you can change to else if and remove the partial_sync bool
src/server/dflycmd.cc
Outdated
| } | ||
| } | ||
|
|
||
| sf_->journal()->StartInThread(); |
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.
also it makes sense to call StartInThread either before/after the 2 condition checks for partial sync
Helps with #5180