-
Notifications
You must be signed in to change notification settings - Fork 522
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
curvebs: support poolset #1988
curvebs: support poolset #1988
Conversation
b2aeffd
to
793262a
Compare
recheck |
2 similar comments
recheck |
recheck |
a46f82b
to
3c50c00
Compare
recheck |
789c384
to
5d0e610
Compare
recheck |
2 similar comments
recheck |
recheck |
48932f1
to
670ac54
Compare
recheck |
1 similar comment
recheck |
670ac54
to
d0883cb
Compare
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.
BTW, delete src/mds/nameserver2/curveadm.
And, write a document for this pr, explain how to upgrade old cluster
tools/curvefsTool.cpp
Outdated
LOG(ERROR) << "No poolsets in cluster map"; | ||
return -1; | ||
} | ||
for (const auto poolset : clusterMap_[kPoolsets]) { |
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.
using const reference to avoid unnecessary copying.
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.
using const reference to avoid unnecessary copying.
fix
tools/curvefsTool.cpp
Outdated
} else if (s == "nvme") { | ||
poolsetData.type = PoolsetType::NVME; | ||
} else { | ||
poolsetData.type = PoolsetType::SSD; |
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's better to report an error in this case instead of giving it a default type.
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's better to report an error in this case instead of giving it a default type.
fix
tools/curvefsTool.cpp
Outdated
if (!server[kPhysicalPool].isString()) { | ||
LOG(ERROR) << "server physicalpool must be string"; | ||
return -1; | ||
} | ||
serverData.physicalPoolName = server[kPhysicalPool].asString(); |
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 seems these code are identical with L402-L406.
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 seems these code are identical with L402-L406.
fix
tools/curvefsTool.cpp
Outdated
poolsetData.type = PoolsetType::SSD; | ||
} | ||
|
||
poolsetDatas.emplace_back(poolsetData); |
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.
poolsetDatas.emplace_back(std::move(poolsetData))
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.
poolsetDatas.emplace_back(std::move(poolsetData))
fix
src/mds/topology/topology_item.cpp
Outdated
@@ -213,6 +233,7 @@ bool PhysicalPool::ParseFromString(const std::string &value) { | |||
id_ = data.physicalpoolid(); | |||
name_ = data.physicalpoolname(); | |||
desc_ = data.desc(); | |||
poolsetId_ = data.poolsetid(); |
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, you should check whether data has poolset id or not, if it don't have it, poolsetId_ should set to UNINTIALIZE_ID.
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.
fix
if(data.has_poolsetid()){
poolsetId_ = data.poolsetid();
}
@@ -97,6 +98,7 @@ class DefaultIdGenerator : public TopologyIdGenerator { | |||
std::atomic<T> idMax_; | |||
}; | |||
|
|||
IdGenerator<PoolsetIdType> poolsetIdGentor_; |
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 seems poolsetIdGentor_
doesn't inited
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 seems
poolsetIdGentor_
doesn't inited
fix, poolsetIdGentor_ is inited
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.
poolsetIdGentor_
init in class TopologyIdGenerator
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.
where does
poolsetIdGentor_
inited?
in class TopologyIdGenerator
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.
where does
poolsetIdGentor_
inited?
in class TopologyIdGenerator
src/mds/topology/topology.cpp
Outdated
} | ||
} | ||
|
||
// int TopologyImpl::RemovePhysicalPoolNotInPoolset(PoolIdType id) { |
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.
remove unused code
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.
remove unused code
fix, the unused code were removed
src/mds/nameserver2/curvefs.cpp
Outdated
auto ifok = chunkSegAllocator_->AllocateChunkSegment( | ||
fileInfo.filetype(), fileInfo.segmentsize(), | ||
fileInfo.chunksize(), offset, segment); | ||
fileInfo.chunksize(), poolset.GetType(), |
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.
noop, segment should be allocated by poolset name instead of type, because we can have more than one poolsets with same type.
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.
noop, segment should be allocated by poolset name instead of type, because we can have more than one poolsets with same type.
fix, parameter has been changed to poolsetName
src/mds/nameserver2/curvefs.cpp
Outdated
@@ -1251,9 +1258,15 @@ StatusCode CurveFS::GetOrAllocateSegment(const std::string & filename, | |||
return StatusCode::kSegmentNotAllocated; | |||
} else { | |||
// TODO(hzsunjianliang): check the user and define the logical pool | |||
if (!fileInfo.has_poolsetname()) { | |||
fileInfo.set_poolsetname("ssdPoolset1"); |
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's no a good idea, a proper way is adding a config item in mds configuration to store the default poolsetname for allocating segment for those files that don't have a poolsetname in fileinfo.
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's no a good idea, a proper way is adding a config item in mds configuration to store the default poolsetname for allocating segment for those files that don't have a poolsetname in fileinfo.
fix, defalut poolsetName has been set in mds.conf
345b4cf
to
44cdbc2
Compare
44cdbc2
to
63c8756
Compare
7ff7e02
to
b339c17
Compare
cicheck |
b339c17
to
78498af
Compare
cicheck |
a7e269d
to
3309c84
Compare
cicheck |
3309c84
to
02a60bd
Compare
cicheck |
* | ||
* @return: success return 0, fail return less than 0 | ||
*/ | ||
int Create2(const char* filename, |
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.
why remove Create2?
@@ -93,6 +93,7 @@ message FileInfo { | |||
|
|||
optional FileThrottleParams throttleParams = 17; | |||
optional uint64 epoch = 18; | |||
optional string poolset = 19; |
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.
Wouldn't it be better to use poolsetid instead?
Signed-off-by: Hanqing Wu <[email protected]>
Signed-off-by: Hanqing Wu <[email protected]>
Co-authored-by: jolly-sy <[email protected]> Co-authored-by: Hanqing Wu <[email protected]> Signed-off-by: jolly-sy <[email protected]> Signed-off-by: Hanqing Wu <[email protected]>
02a60bd
to
6f2f0e5
Compare
cicheck |
1 similar comment
cicheck |
f7028c0
to
73a8a8f
Compare
cicheck |
…directories Signed-off-by: Hanqing Wu <[email protected]>
73a8a8f
to
fe08f0c
Compare
cicheck |
Please add a poolset-related ReadMe in the appropriate section, for exmaple: how to use |
I will update curveadm wiki later. |
What problem does this PR solve?
Issue Number: #xxx
Problem Summary:
What is changed and how it works?
What's Changed:
How it Works:
Side effects(Breaking backward compatibility? Performance regression?):
Check List