Skip to content
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

Support leader change in meta client && do some refactors #354

Merged
merged 5 commits into from
May 13, 2019
Merged

Support leader change in meta client && do some refactors #354

merged 5 commits into from
May 13, 2019

Conversation

dangleptr
Copy link
Contributor

@dangleptr dangleptr commented May 10, 2019

subtask of #283

@nebula-community-bot
Copy link
Member

Unit testing passed.

remoteFunc(client, std::move(req))
.then(evb, [p = std::move(pro), respGen, this] (folly::Try<RpcResponse>&& t) mutable {
// exception occurred during RPC
if (t.hasException()) {
p.setValue(Status::Error(folly::stringPrintf("RPC failure in MetaClient: %s",
t.exception().what().c_str())));
{
folly::RWSpinLock::WriteHolder holder(hostLock_);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not put hostLock_ inside updateHost()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds reasonable

@@ -35,7 +35,7 @@ ServerBasedSchemaManager::getTagSchema(GraphSpaceID space, TagID tag, SchemaVer
if (ver < 0) {
ver = getNewestTagSchemaVer(space, tag);
}
auto ret = metaClient_->getTagSchemeFromCache(space, tag, ver);
auto ret = metaClient_->getTagSchemaFromCache(space, tag, ver);
Copy link
Contributor

Choose a reason for hiding this comment

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

Bright eyes

return Status::Error("existed!");
case cpp2::ErrorCode::E_NOT_FOUND:
return Status::Error("not existed!");
case cpp2::ErrorCode::E_LEADER_CHANGED: {
Copy link
Contributor

Choose a reason for hiding this comment

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

When the leader changes ,getResponse() returns the error code E_LEADER_CHANGED, then the resend message is triggered by the trigger itself(Sometimes is users, but they don't need know this).
Why not try to resend through getResponse() or unified process?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Retry logic is another story not related to this pr.

@dangleptr dangleptr added the ready-for-testing PR: ready for the CI test label May 13, 2019
@nebula-community-bot
Copy link
Member

Unit testing passed.

@nebula-community-bot
Copy link
Member

Unit testing passed.

Copy link
Contributor

@darionyaphet darionyaphet left a comment

Choose a reason for hiding this comment

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

LGTM

@nebula-community-bot
Copy link
Member

Unit testing passed.

@dutor dutor merged commit b9020cd into vesoft-inc:master May 13, 2019
@dutor dutor deleted the meta-client branch May 13, 2019 07:58
tong-hao pushed a commit to tong-hao/nebula that referenced this pull request Jun 1, 2021
…#354)

* Support leader change in meta client && do some refactors

* Address @laura-ding's comments

* Fix remove tag schema bug
yixinglu pushed a commit to yixinglu/nebula that referenced this pull request Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants