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

[feat]: curvefs: merge two rpc into one rpc when makenode #2680

Merged
merged 1 commit into from
Sep 12, 2023

Conversation

201341
Copy link
Contributor

@201341 201341 commented Aug 7, 2023

What problem does this PR solve?

Issue Number: #2548

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
Copy link
Contributor Author

201341 commented Aug 15, 2023

cicheck

@201341 201341 requested a review from SeanHai August 15, 2023 05:37
@201341
Copy link
Contributor Author

201341 commented Aug 21, 2023

@SeanHai PTAL

@@ -114,6 +114,10 @@ message CreateDentryRequest {
required uint32 copysetId = 2;
required uint32 partitionId = 3;
required Dentry dentry = 4;
required bool enableSumInDir = 5;
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. required need change to optional for compatible upgrade.
  2. enableSumInDir is not needed and update to parent inode directly, the function enablesumInDir will be discarded.
  3. new file length is 0 and length here is not needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For FuseOpLink And FuseOpSymLink, length is not zero, So length is needed?

@201341 201341 force-pushed the swj/opt-makenode branch 6 times, most recently from 80f2d22 to c95616d Compare September 1, 2023 03:33
@201341
Copy link
Contributor Author

201341 commented Sep 1, 2023

cicheck

2 similar comments
@201341
Copy link
Contributor Author

201341 commented Sep 4, 2023

cicheck

@caoxianfei1
Copy link
Contributor

cicheck

std::string key = GetDentryCacheKey(dentry.parentinodeid(), dentry.name());
NameLockGuard lock(nameLock_, key);
MetaStatusCode ret = metaClient_->CreateDentry(dentry);
MetaStatusCode ret = metaClient_->CreateDentry(dentry,
Copy link
Contributor

Choose a reason for hiding this comment

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

You can get time here and no need to pass it from above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

@@ -274,6 +274,8 @@ FSStatusCode MetaserverClient::CreateDentry(
d->set_txid(0);
d->set_type(FsFileType::TYPE_DIRECTORY);
request.set_allocated_dentry(d);
request.set_time(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

It may be more appropriate to use real time

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

<< ", type: " << type
<< ", isCreate: " << isCreate;
// already be deleted
return MetaStatusCode::OK;
}

NameLockGuard lg(inodeLock_, GetInodeLockName(fsId, parentInodeId));
Copy link
Contributor

Choose a reason for hiding this comment

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

The namelock should get before inodeStorage_->Get

@201341
Copy link
Contributor Author

201341 commented Sep 5, 2023

cicheck

@SeanHai
Copy link
Contributor

SeanHai commented Sep 5, 2023

LGTM!

Comment on lines 117 to 118
optional uint64 time = 5;
optional uint32 time_ns = 6;
Copy link
Contributor

Choose a reason for hiding this comment

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

you can use Time in L290

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

MetaStatusCode UpdateInodeWhenCreateOrRemoveSubNode(uint32_t fsId,
uint64_t inodeId, FsFileType type, bool isCreate);
MetaStatusCode UpdateInodeWhenCreateOrRemoveSubNode(
Dentry dentry,
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
Dentry dentry,
const Dentry& dentry,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

Comment on lines 60 to 61
uint64_t now,
uint32_t now_ns);
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto, use Time in proto

Signed-off-by: swj <1186093704@qq.com>
@201341
Copy link
Contributor Author

201341 commented Sep 7, 2023

cicheck

@SeanHai SeanHai merged commit a844674 into opencurve:master Sep 12, 2023
3 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.

None yet

4 participants