allocate ec shards to volume servers
This commit is contained in:
@@ -30,11 +30,11 @@ func (dn *DataNode) UpdateEcShards(actualShards []*erasure_coding.EcVolumeInfo)
|
||||
} else {
|
||||
// found, but maybe the actual shard could be missing
|
||||
a := actualEcShards.Minus(ecShards)
|
||||
if len(a.ShardIds()) > 0 {
|
||||
if a.ShardIdCount() > 0 {
|
||||
newShards = append(newShards, a)
|
||||
}
|
||||
d := ecShards.Minus(actualEcShards)
|
||||
if len(d.ShardIds()) > 0 {
|
||||
if d.ShardIdCount() > 0 {
|
||||
deletedShards = append(deletedShards, d)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,11 +7,9 @@ import (
|
||||
"github.com/chrislusf/seaweedfs/weed/storage/needle"
|
||||
)
|
||||
|
||||
const shardCount = erasure_coding.DataShardsCount + erasure_coding.ParityShardsCount
|
||||
|
||||
type EcShardLocations struct {
|
||||
Collection string
|
||||
locations [shardCount][]*DataNode
|
||||
locations [erasure_coding.TotalShardsCount][]*DataNode
|
||||
}
|
||||
|
||||
func (t *Topology) SyncDataNodeEcShards(shardInfos []*master_pb.VolumeEcShardInformationMessage, dn *DataNode) (newShards, deletedShards []*erasure_coding.EcVolumeInfo) {
|
||||
|
||||
Reference in New Issue
Block a user