add remove volumes with version info

This commit is contained in:
Chris Lu
2019-04-20 23:53:37 -07:00
parent 64a9a0e104
commit 316bd27f75
7 changed files with 155 additions and 85 deletions

View File

@@ -189,7 +189,6 @@ func (t *Topology) IncrementalSyncDataNodeRegistration(newVolumes, deletedVolume
continue
}
newVis = append(newVis, vi)
t.RegisterVolumeLayout(vi, dn)
}
for _, v := range deletedVolumes {
vi, err := storage.NewVolumeInfoFromShort(v)
@@ -198,8 +197,15 @@ func (t *Topology) IncrementalSyncDataNodeRegistration(newVolumes, deletedVolume
continue
}
oldVis = append(oldVis, vi)
t.UnRegisterVolumeLayout(vi, dn)
}
dn.DeltaUpdateVolumes(newVis, oldVis)
for _, vi := range newVis {
t.RegisterVolumeLayout(vi, dn)
}
for _, vi := range oldVis {
t.UnRegisterVolumeLayout(vi, dn)
}
return
}