-
Notifications
You must be signed in to change notification settings - Fork 527
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
Conversation
6018699
to
106a550
Compare
106a550
to
2ca6b85
Compare
cicheck |
@SeanHai PTAL |
curvefs/proto/metaserver.proto
Outdated
@@ -114,6 +114,10 @@ message CreateDentryRequest { | |||
required uint32 copysetId = 2; | |||
required uint32 partitionId = 3; | |||
required Dentry dentry = 4; | |||
required bool enableSumInDir = 5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- required need change to optional for compatible upgrade.
- enableSumInDir is not needed and update to parent inode directly, the function enablesumInDir will be discarded.
- new file length is 0 and length here is not needed
There was a problem hiding this comment.
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?
80f2d22
to
c95616d
Compare
cicheck |
2 similar comments
cicheck |
cicheck |
std::string key = GetDentryCacheKey(dentry.parentinodeid(), dentry.name()); | ||
NameLockGuard lock(nameLock_, key); | ||
MetaStatusCode ret = metaClient_->CreateDentry(dentry); | ||
MetaStatusCode ret = metaClient_->CreateDentry(dentry, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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
c95616d
to
e421f66
Compare
cicheck |
LGTM! |
curvefs/proto/metaserver.proto
Outdated
optional uint64 time = 5; | ||
optional uint32 time_ns = 6; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dentry dentry, | |
const Dentry& dentry, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
curvefs/src/metaserver/partition.h
Outdated
uint64_t now, | ||
uint32_t now_ns); |
There was a problem hiding this comment.
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>
e421f66
to
4cce35b
Compare
cicheck |
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