chrislu
2022-09-10 11:22:16 -07:00
parent 205ecb5d03
commit 576c113c59
3 changed files with 9 additions and 3 deletions

View File

@@ -258,7 +258,9 @@ func (t *Topology) UnRegisterVolumeLayout(v storage.VolumeInfo, dn *DataNode) {
}
func (t *Topology) GetOrCreateDataCenter(dcName string) *DataCenter {
for _, c := range t.Children() {
t.Lock()
defer t.Unlock()
for _, c := range t.children {
dc := c.(*DataCenter)
if string(dc.Id()) == dcName {
return dc