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 a command to unlock meta_op_status manually #1014

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

GiantKing
Copy link
Contributor

apache/incubator-pegasus#845

Add a command to unlock meta_op_status manually. And show meta_op_status in Pegasus shell : "cluster_info".

@@ -228,6 +228,8 @@ class replication_ddl_client
error_with<query_app_manual_compact_response>
query_app_manual_compact(const std::string &app_name);

dsn::error_code unlock_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.

remove dsn::

@@ -1712,5 +1712,23 @@ replication_ddl_client::query_app_manual_compact(const std::string &app_name)
query_manual_compact_rpc(std::move(req), RPC_CM_QUERY_MANUAL_COMPACT_STATUS));
}

dsn::error_code replication_ddl_client::unlock_meta_op_status()
{
std::shared_ptr<unlock_meta_op_status_request> req =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto req = std::make_shared<unlock_meta_op_status_request>();

std::make_shared<unlock_meta_op_status_request>();

auto resp_task = request_meta<unlock_meta_op_status_request>(RPC_CM_UNLOCK_META_OP_STATUS, req);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this blank line

{
ddebug_f("UNLOCK meta op status from {}", enum_to_string(_meta_op_status.load()));
ddebug_f("UNLOCK meta op status from {}, is_manual {}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ddebug_f("UNLOCK meta op status from {}, is_manual = {}", enum_to_string(_meta_op_status.load()), is_manual);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote as you say, but modified by clang-format. It is not bad in multi lines.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean add a = after is_manual

}

unlock_meta_op_status_response resp;
::dsn::unmarshall(resp_task->get_response(), resp);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove ::dsn::

@@ -1712,5 +1712,23 @@ replication_ddl_client::query_app_manual_compact(const std::string &app_name)
query_manual_compact_rpc(std::move(req), RPC_CM_QUERY_MANUAL_COMPACT_STATUS));
}

dsn::error_code replication_ddl_client::unlock_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.

same

@@ -329,7 +329,7 @@ class app_info
expire_second(0),
create_second(0),
drop_second(0),
duplicating(0),
duplicating(false),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this files change? It seems that related .thrift is not updated.

@@ -162,7 +162,7 @@ class meta_service : public serverlet<meta_service>
size_t get_alive_node_count() const;

bool try_lock_meta_op_status(meta_op_status op_status);
void unlock_meta_op_status();
void unlock_meta_op_status(bool is_manual = false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that is_manual is useless, what is it usage?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for debug log

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.

3 participants