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 58
feat(op_status_lock): add an operation status lock for meta #977
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
levy5307
reviewed
Dec 6, 2021
src/meta/meta_service.h
Outdated
@@ -67,6 +68,38 @@ class test_checker; | |||
|
|||
DEFINE_TASK_CODE(LPC_DEFAULT_CALLBACK, TASK_PRIORITY_COMMON, dsn::THREAD_POOL_DEFAULT) | |||
|
|||
struct meta_op_status |
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.
What about implement like this?
enum class meta_op_status {
...
}
ENUM_BEGIN()
...
ENUM_END()
levy5307
reviewed
Dec 6, 2021
src/meta/meta_service.cpp
Outdated
@@ -260,6 +260,26 @@ void meta_service::get_node_state(/*out*/ std::map<rpc_address, bool> &all_nodes | |||
|
|||
void meta_service::balancer_run() { _state->check_all_partitions(); } | |||
|
|||
bool meta_service::try_lock_meta_op_status(meta_op_status::type op_status) |
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.
I think you can add some unit tests for these functions.
foreverneverer
previously approved these changes
Dec 7, 2021
levy5307
previously approved these changes
Dec 7, 2021
Smityz
previously approved these changes
Dec 7, 2021
GiantKing
dismissed stale reviews from Smityz, levy5307, and foreverneverer
via
December 9, 2021 09:01
3e3a542
levy5307
approved these changes
Dec 9, 2021
Smityz
approved these changes
Dec 9, 2021
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.
apache/incubator-pegasus#845