Skip to content

Commit

Permalink
fix curvefs topology lock
Browse files Browse the repository at this point in the history
Signed-off-by: wanghai01 <[email protected]>
  • Loading branch information
SeanHai committed Dec 13, 2023
1 parent 754b19e commit d25dff5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion curvefs/src/mds/topology/topology.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ TopoStatusCode TopologyImpl::RemoveServer(ServerIdType id) {
}

TopoStatusCode TopologyImpl::RemoveMetaServer(MetaServerIdType id) {
WriteLockGuard wlockPool(poolMutex_);
WriteLockGuard wlockServer(serverMutex_);
WriteLockGuard wlockMetaServer(metaServerMutex_);
auto it = metaServerMap_.find(id);
Expand All @@ -243,7 +244,6 @@ TopoStatusCode TopologyImpl::RemoveMetaServer(MetaServerIdType id) {
metaServerMap_.erase(it);

// update pool
WriteLockGuard wlockPool(poolMutex_);
PoolIdType poolId = ix->second.GetPoolId();
auto it = poolMap_.find(poolId);
if (it != poolMap_.end()) {
Expand Down

0 comments on commit d25dff5

Please sign in to comment.