This repository has been archived by the owner on Jun 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 59
feat(one-time backup): part-1 meta server handle rpc and init backup #772
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
neverchanje
reviewed
Mar 4, 2021
levy5307
reviewed
Mar 4, 2021
levy5307
reviewed
Mar 4, 2021
levy5307
reviewed
Mar 4, 2021
zhangyifan27
force-pushed
the
one_time_backup
branch
from
March 5, 2021 08:01
028fc7f
to
d03d910
Compare
zhangyifan27
changed the title
feat(one-time backup): implement one-time backup in meta_backup_service
feat(one-time backup): part-1 meta server handle rpc and init backup
Mar 5, 2021
neverchanje
reviewed
Mar 5, 2021
neverchanje
reviewed
Mar 8, 2021
neverchanje
previously approved these changes
Mar 8, 2021
hycdong
reviewed
Mar 8, 2021
hycdong
approved these changes
Mar 8, 2021
neverchanje
approved these changes
Mar 8, 2021
|
||
backup_engine::~backup_engine() { _tracker.cancel_outstanding_tasks(); } | ||
|
||
error_code backup_engine::get_app_stat(int32_t app_id, std::shared_ptr<app_state> &app) |
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.
"stat" and "state" are different. The former is usually the abbr of "statistics."
Suggested change
error_code backup_engine::get_app_stat(int32_t app_id, std::shared_ptr<app_state> &app) | |
error_code backup_engine::get_app_state(int32_t app_id, /*out*/ std::shared_ptr<app_state> &app) |
bool is_backing_up(); | ||
|
||
private: | ||
error_code get_app_stat(int32_t app_id, std::shared_ptr<app_state> &app); |
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.
Suggested change
error_code get_app_stat(int32_t app_id, std::shared_ptr<app_state> &app); | |
error_code get_app_stat(int32_t app_id, /*out*/ std::shared_ptr<app_state> &app); |
dsn::task_tracker _tracker; | ||
|
||
// lock the following variables. | ||
dsn::zlock _lock; |
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.
You can declare _lock
a mutable so that you can let is_backing_up
const. Making locks mutable is a convention in C++.
bool is_backing_up() const;
Suggested change
dsn::zlock _lock; | |
mutable dsn::zlock _lock; |
You can do the commented fixes in later pr. No big problems :) |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prior to this patch, we could only backup tables by creating a
policy
. But there are some issues inpolicy
:start_time
.interval time
is less than 24 hours, the behavior ofpolicy_context
would be uncontrollable.In this patch, meta server could start backup tables immediately after received a backup rpc.
TODO: