erasure coding: tracking encoded/decoded volumes

If an EC shard is created but not spread to other servers, the masterclient would think this shard is not located here.
This commit is contained in:
chrislu
2022-04-05 19:03:02 -07:00
parent 8b3d76b24d
commit bc888226fc
7 changed files with 503 additions and 419 deletions

View File

@@ -58,7 +58,7 @@ func (dn *DataNode) UpdateEcShards(actualShards []*erasure_coding.EcVolumeInfo)
}
for _, ecShards := range actualShards {
if dn.hasEcShards(ecShards.VolumeId) {
if dn.HasEcShards(ecShards.VolumeId) {
continue
}
@@ -79,7 +79,7 @@ func (dn *DataNode) UpdateEcShards(actualShards []*erasure_coding.EcVolumeInfo)
return
}
func (dn *DataNode) hasEcShards(volumeId needle.VolumeId) (found bool) {
func (dn *DataNode) HasEcShards(volumeId needle.VolumeId) (found bool) {
dn.RLock()
defer dn.RUnlock()
for _, c := range dn.children {