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

[fix] curvefs: mds: createfs error #2791

Merged
merged 1 commit into from
Nov 16, 2023

Conversation

201341
Copy link
Contributor

@201341 201341 commented Oct 11, 2023

What problem does this PR solve?

Issue Number: #2779

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

@201341 201341 force-pushed the swj/fix-createfs branch 2 times, most recently from b2916c4 to a7109a7 Compare October 11, 2023 07:43
@201341
Copy link
Contributor Author

201341 commented Oct 11, 2023

cicheck

@201341 201341 requested a review from Cyber-SiKu October 12, 2023 02:08
@201341
Copy link
Contributor Author

201341 commented Oct 12, 2023

@Cyber-SiKu PTAL

@201341
Copy link
Contributor Author

201341 commented Oct 18, 2023

cicheck

@201341
Copy link
Contributor Author

201341 commented Oct 20, 2023

@Cyber-SiKu PTAL

@201341 201341 force-pushed the swj/fix-createfs branch 4 times, most recently from af61bbe to ac73df0 Compare October 24, 2023 02:31
@201341
Copy link
Contributor Author

201341 commented Oct 24, 2023

cicheck

1 similar comment
@201341
Copy link
Contributor Author

201341 commented Oct 24, 2023

cicheck

Comment on lines 813 to 823
if (lhs.has_objectprefix() && !rhs.has_objectprefix() &&
lhs.objectprefix() != 0) {
return false;
}
if (rhs.has_objectprefix() && !lhs.has_objectprefix() &&
rhs.objectprefix() != 0) {
return false;
}

return google::protobuf::util::MessageDifferencer::Equals(lhs, rhs);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (lhs.has_objectprefix() && !rhs.has_objectprefix() &&
lhs.objectprefix() != 0) {
return false;
}
if (rhs.has_objectprefix() && !lhs.has_objectprefix() &&
rhs.objectprefix() != 0) {
return false;
}
return google::protobuf::util::MessageDifferencer::Equals(lhs, rhs);
if (lhs.has_prefix() && rhs.has_prefix() && (lhs.prefix() != rhs.prefix())) {
return false;
}
lhs.clear_prefix();
rhs.clear_prefix();
return Equals(lhs, rhs);

Are they equivalent? If so, this might look clearer. BTW, pls add corresponding tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it's different. This change is mainly for compatibility with old clients which don't have object_prefix attribute. For test, I will add it later.

Copy link
Contributor

Choose a reason for hiding this comment

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

No, it's different. This change is mainly for compatibility with old clients which don't have object_prefix attribute. For test, I will add it later.

The problem is clear, and, as my understanding, we just need to ensure if both have prefix, then they must be same, otherwise, we can ignore this field.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It can't cover the condition that the old client which doesn't have prefix, and the new client has the prefix which is 1 .

@201341 201341 force-pushed the swj/fix-createfs branch 2 times, most recently from 17b3b11 to 06391b8 Compare October 25, 2023 06:23
@201341
Copy link
Contributor Author

201341 commented Oct 25, 2023

cicheck

4 similar comments
@Cyber-SiKu
Copy link
Contributor

cicheck

@Cyber-SiKu
Copy link
Contributor

cicheck

@Cyber-SiKu
Copy link
Contributor

cicheck

@Cyber-SiKu
Copy link
Contributor

cicheck

@201341 201341 requested a review from wu-hanqing November 2, 2023 02:52
@201341
Copy link
Contributor Author

201341 commented Nov 2, 2023

@wu-hanqing PTAL

Comment on lines 809 to 810
auto s3InfoComparator = [](common::S3Info lhs, common::S3Info rhs) {
// for compatible with old clients
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add more comments to explain scenarios that require compatibility, and renaming parameters because it is impossible to clearly distinguish which is the MDS side and which is the fs the current client is preparing to create.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The parameters' meaning depends on the caller, If changing the parameters, the caller must pass the parameter in the correct order. Is there any need to make changes?

Copy link
Contributor

Choose a reason for hiding this comment

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

The parameters' meaning depends on the caller, If changing the parameters, the caller must pass the parameter in the correct order. Is there any need to make changes?

The parameters of a function are part of the calling convention and should not depend on the caller. The caller needs to pass in the parameters according to the parameters of the function as specified.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@201341 201341 closed this Nov 14, 2023
@201341 201341 reopened this Nov 14, 2023
@201341
Copy link
Contributor Author

201341 commented Nov 14, 2023

cicheck

@201341
Copy link
Contributor Author

201341 commented Nov 15, 2023

cicheck

1 similar comment
@201341
Copy link
Contributor Author

201341 commented Nov 15, 2023

cicheck

@wuhongsong wuhongsong merged commit a22e6d1 into opencurve:master Nov 16, 2023
4 checks passed
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.

4 participants