Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

feat(op_status_lock): add an operation status lock for meta #977

Merged
merged 3 commits into from
Dec 9, 2021

Conversation

GiantKing
Copy link
Contributor

@@ -67,6 +68,38 @@ class test_checker;

DEFINE_TASK_CODE(LPC_DEFAULT_CALLBACK, TASK_PRIORITY_COMMON, dsn::THREAD_POOL_DEFAULT)

struct meta_op_status
Copy link
Contributor

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()

@@ -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)
Copy link
Contributor

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
foreverneverer previously approved these changes Dec 7, 2021
levy5307
levy5307 previously approved these changes Dec 7, 2021
Smityz
Smityz previously approved these changes Dec 7, 2021
@levy5307 levy5307 merged commit 2b08ee7 into XiaoMi:master Dec 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants