Set volumes ReadOnly if low free disk space

This commit is contained in:
Evgenii Kozlov
2020-06-05 18:18:15 +03:00
parent 393ab07c7c
commit 0e0db70f55
8 changed files with 73 additions and 21 deletions

View File

@@ -212,13 +212,18 @@ func (t *Topology) SyncDataNodeRegistration(volumes []*master_pb.VolumeInformati
}
}
// find out the delta volumes
newVolumes, deletedVolumes = dn.UpdateVolumes(volumeInfos)
var changedVolumes []storage.VolumeInfo
newVolumes, deletedVolumes, changedVolumes = dn.UpdateVolumes(volumeInfos)
for _, v := range newVolumes {
t.RegisterVolumeLayout(v, dn)
}
for _, v := range deletedVolumes {
t.UnRegisterVolumeLayout(v, dn)
}
for _, v := range changedVolumes {
vl := t.GetVolumeLayout(v.Collection, v.ReplicaPlacement, v.Ttl)
vl.ensureCorrectWritables(&v)
}
return
}