controller: Replica scheduled to the node that shouldn't able to scheduled
ScheduledReplica map should create a new map before update in node
controller, otherwise StorageScheduled value will not consistent with
ScheduledReplica which will cause scheduler issue.
@@ -392,10 +392,7 @@ func (nc *NodeController) syncDiskStatus(node *longhorn.Node) error {
if ok {
diskStatus = originDiskStatus[diskID]
}
- scheduledReplica := diskStatus.ScheduledReplica
- if scheduledReplica == nil {
- scheduledReplica = map[string]int64{}
- }
+ scheduledReplica := map[string]int64{}
// if there's no replica assigned to this disk
if _, ok := replicaDiskMap[diskID]; !ok {
diskStatus.StorageScheduled = 0
