-
Notifications
You must be signed in to change notification settings - Fork 1k
chore: improve partial sync and test #5195
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
base: kpr2
Are you sure you want to change the base?
Conversation
return ring_buffer_.front().lsn == lsn; | ||
} | ||
|
||
return ring_buffer_.front().lsn <= lsn && lsn <= ring_buffer_.back().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.
So much cleaner now...l
// std::string shard_path_; | ||
// std::unique_ptr<LinuxFile> shard_file_; | ||
std::optional<base::RingBuffer<JournalItem>> ring_buffer_; | ||
boost::circular_buffer<JournalItem> ring_buffer_; |
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.
bye bye std::optional
and base::RingBuffer
. Welcome boost::circular_buffer
:)
return; | ||
|
||
ring_buffer_.emplace(2); | ||
ring_buffer_.set_capacity(absl::GetFlag(FLAGS_shard_repl_backlog_len)); |
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 works for non power of two now :)
Signed-off-by: kostas <kostas@dragonflydb.io>
This pr replaces helio
base/ring_buffer
withboost/circular_buffer
forsimplicity
andcorrectness
.base/ring_buffer
withboost/circular_buffer
Addresses #5180