-
Notifications
You must be signed in to change notification settings - Fork 990
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
feat(server): dont use channel for replication / save df #4041
Conversation
} | ||
|
||
void RdbSaver::Impl::StartIncrementalSnapshotting(Context* cntx, EngineShard* shard, | ||
LSN start_lsn) { | ||
auto& db_slice = namespaces.GetDefaultNamespace().GetDbSlice(shard->shard_id()); | ||
auto& s = GetSnapshot(shard); | ||
s = std::make_unique<SliceSnapshot>(&db_slice, &channel_, compression_mode_); | ||
auto on_finalize_cb = std::bind(&RdbSaver::Impl::FinalizeSnapshotWriting, this); |
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.
it's possible to do like this. not critical but when you pass two lambdas, maybe it's a sign that using an virtual interface is a better pattern here, and make RdbSaver::Impl
derive from it.
void SaveStagesController::SaveCb(unsigned index) { | ||
if (auto& snapshot = snapshots_[index].first; snapshot && snapshot->HasStarted()) | ||
void SaveStagesController::SaveBody(unsigned index) { | ||
CHECK(!use_dfs_format_ || index == shard_set->size()); |
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 CHECK is weird index == shard_set->size()
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 use SaveBody for rdb save and for summary file in df save.
We can do several refactoring here for more readable code but I want this pr to be not so big
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.
added a comment for now
src/server/snapshot.h
Outdated
@@ -85,7 +76,7 @@ class SliceSnapshot { | |||
|
|||
// Waits for a regular, non journal snapshot to finish. | |||
// Called only for non-replication, backups usecases. | |||
void Join() { | |||
void WaitSnapshoting() { |
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.
WaitSnapshoting -> WaitSnapshotting
please check if you have more shoting
cases
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.
done
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
I think it will be more readable if we deduplicate some of the RdbSerializer functions so that we won't have two sets of functions - one for replication and one for snapshotting.
I will do addittional refactoring changes in a separate PR ok? |
Yeah sure, it was a general comment 👌 |
Signed-off-by: adi_holden <[email protected]>
Signed-off-by: adi_holden <[email protected]>
Signed-off-by: adi_holden <[email protected]>
Co-authored-by: Roman Gershman <[email protected]> Signed-off-by: adiholden <[email protected]>
Co-authored-by: Roman Gershman <[email protected]> Signed-off-by: adiholden <[email protected]>
Co-authored-by: Roman Gershman <[email protected]> Signed-off-by: adiholden <[email protected]>
Signed-off-by: adi_holden <[email protected]>
549ea37
to
5c14022
Compare
* feat server: dont use channel for replication / save df Signed-off-by: adi_holden <[email protected]>
fixes #4040