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: fix create partition error at parallel case #1511

Merged
merged 1 commit into from
May 26, 2022

Conversation

SeanHai
Copy link
Contributor

@SeanHai SeanHai commented May 26, 2022

What problem does this PR solve?

Issue Number: #xxx
#1501 #1503

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

@@ -632,6 +632,9 @@ void TopologyManager::CreatePartitions(const CreatePartitionRequest *request,
auto partitionInfoList = response->mutable_partitioninfolist();
response->set_statuscode(TopoStatusCode::TOPO_OK);

// get lock and avoid multiMountpoint create concurrently
NameLockGuard lock(createPartitionMutex_, std::to_string(fsId));

while (partitionInfoList->size() < count) {
Copy link
Contributor

Choose a reason for hiding this comment

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

uint32_t pNumber = topology_->GetPartitionNumberOfFs(fsId);
uint64_t idStart = pNumber * option_.idNumberInPartition;
uint64_t idEnd = (pNumber + 1) * option_.idNumberInPartition - 1;

if delete partition, the start and end will duplicate.
fix it or add a todo here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will fix at another pr later.

@SeanHai
Copy link
Contributor Author

SeanHai commented May 26, 2022

recheck

@SeanHai SeanHai merged commit fc2a7dd into opencurve:master May 26, 2022
@SeanHai SeanHai linked an issue May 27, 2022 that may be closed by this pull request
@SeanHai SeanHai deleted the fix_create_partition branch June 8, 2022 11:12
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.

stat fail with err "No such file or directory"
3 participants