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

curvefs mds heartbeat doesn't delete copyset creating. #1011

Merged
merged 1 commit into from
Jan 19, 2022

Conversation

SeanHai
Copy link
Contributor

@SeanHai SeanHai commented Jan 18, 2022

curvefs mds heartbeat doesn't delete copyset creating.
The empty conf will send to metaserver to delete copysets which don't exist in mds, but when the copyset just created in metaserver and have not add to topology, the metaserver heartbeat will contain these copysets' infomation.

What problem does this PR solve?

Issue Number: close #xxx
#999

Problem Summary:

What is changed and how it works?

What's Changed:

How it Works:

Side effects(Breaking backward compatibility? Performance regression?):

Check List

  • Relevant documentation/comments is changed or added
  • I acknowledge that all my contributions will be made under the project's license

@SeanHai
Copy link
Contributor Author

SeanHai commented Jan 18, 2022

recheck

@@ -445,6 +451,8 @@ class TopologyImpl : public Topology {

std::string GetHostNameAndPortById(MetaServerIdType msId) override;

bool IsCopysetCreating(const CopySetKey &key) override;
Copy link
Contributor

Choose a reason for hiding this comment

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

declare it as const member functions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

declare it as const member functions

fixed.


bool TopologyImpl::IsCopysetCreating(const CopySetKey &key) {
ReadLockGuard rlockCopySetCreating(copySetCreatingMutex_);
return copySetCreating_.find(key) == copySetCreating_.end() ? false : true;
Copy link
Contributor

Choose a reason for hiding this comment

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

return copysetCreating_.find(key) != copysetCreating_.end();
// or
return coypsetCreating_.count(key) != 0;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

return copysetCreating_.find(key) != copysetCreating_.end();
// or
return coypsetCreating_.count(key) != 0;

fixed

The empty conf will send to metaserver to delete copysets which don't exist in mds, but when the copyset just created in metaserver and have not add to topology, the metaserver heartbeat will contain these copysets' infomation.
topology_->RemoveCopySetCreating(CopySetKey(poolId, id));
}
}

TopoStatusCode TopologyManager::CreateCopyset() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does CreateCopyset have concurrency?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does CreateCopyset have concurrency?

Concurrency occurs in extreme cases, but the copysets' id must be different.

@SeanHai SeanHai merged commit beac479 into opencurve:master Jan 19, 2022
@SeanHai SeanHai deleted the delete_copyset branch January 21, 2022 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants