diff --git a/weed/pb/master.proto b/weed/pb/master.proto index c1d3ac00d..6f7db5d96 100644 --- a/weed/pb/master.proto +++ b/weed/pb/master.proto @@ -77,7 +77,7 @@ message VolumeShortInformationMessage { message VolumeEcShardInformationMessage { uint32 id = 1; string collection = 2; - uint32 ec_index = 3; + uint32 ec_index_bits = 3; } message Empty { diff --git a/weed/pb/master_pb/master.pb.go b/weed/pb/master_pb/master.pb.go index 29ec83050..70326384e 100644 --- a/weed/pb/master_pb/master.pb.go +++ b/weed/pb/master_pb/master.pb.go @@ -352,9 +352,9 @@ func (m *VolumeShortInformationMessage) GetTtl() uint32 { } type VolumeEcShardInformationMessage struct { - Id uint32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` - Collection string `protobuf:"bytes,2,opt,name=collection" json:"collection,omitempty"` - EcIndex uint32 `protobuf:"varint,3,opt,name=ec_index,json=ecIndex" json:"ec_index,omitempty"` + Id uint32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` + Collection string `protobuf:"bytes,2,opt,name=collection" json:"collection,omitempty"` + EcIndexBits uint32 `protobuf:"varint,3,opt,name=ec_index_bits,json=ecIndexBits" json:"ec_index_bits,omitempty"` } func (m *VolumeEcShardInformationMessage) Reset() { *m = VolumeEcShardInformationMessage{} } @@ -376,9 +376,9 @@ func (m *VolumeEcShardInformationMessage) GetCollection() string { return "" } -func (m *VolumeEcShardInformationMessage) GetEcIndex() uint32 { +func (m *VolumeEcShardInformationMessage) GetEcIndexBits() uint32 { if m != nil { - return m.EcIndex + return m.EcIndexBits } return 0 } @@ -1562,105 +1562,105 @@ var _Seaweed_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("master.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1586 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xd4, 0x58, 0xcd, 0x72, 0xdc, 0xc4, - 0x13, 0xb7, 0xf6, 0x7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 0xb2, 0xe9, 0x7b, 0x38, 0xa0, 0x3b, - 0x1e, 0xa1, 0x38, 0x30, 0xf1, 0xb7, 0x53, 0x4c, 0x28, 0xdb, 0x21, 0xb0, 0x27, 0x58, 0x56, 0x1d, - 0x3e, 0x36, 0xbe, 0x83, 0xae, 0xa0, 0x78, 0x27, 0x74, 0x38, 0xb1, 0xec, 0x1a, 0x58, 0xb9, 0x11, - 0x46, 0x6c, 0x58, 0xa8, 0x43, 0xa5, 0x62, 0x1d, 0x5a, 0x83, 0x06, 0x4f, 0xd4, 0x99, 0x2b, 0x75, - 0x96, 0x7b, 0x3d, 0x97, 0x64, 0xaf, 0xcb, 0x15, 0xea, 0x0a, 0x57, 0xb7, 0x92, 0x5c, 0xea, 0xb9, - 0xc4, 0x78, 0x06, 0x2b, 0x3b, 0x61, 0x78, 0x38, 0x8d, 0x84, 0x1b, 0x89, 0xaf, 0xf9, 0x13, 0x6a, - 0xc3, 0x32, 0xdb, 0x33, 0x3d, 0xe1, 0x59, 0xd7, 0x6c, 0xfc, 0xad, 0xc1, 0x6a, 0x1e, 0x56, 0x66, - 0xac, 0x6f, 0x60, 0x25, 0xc5, 0xb5, 0x7c, 0x79, 0x66, 0xb1, 0x41, 0x6b, 0xe3, 0xb6, 0x72, 0x99, - 0x8b, 0x56, 0x27, 0x55, 0xcb, 0x4d, 0xc8, 0x32, 0xfb, 0x47, 0x05, 0x09, 0x19, 0x1c, 0x43, 0xaf, - 0x68, 0xc6, 0x92, 0x42, 0xba, 0xab, 0x64, 0xb6, 0x91, 0xac, 0x44, 0x1f, 0x42, 0x33, 0x73, 0xa4, - 0xc4, 0x1d, 0x59, 0xc9, 0x39, 0x22, 0xf7, 0xca, 0xac, 0xd0, 0x2a, 0x54, 0x71, 0x1c, 0x87, 0x49, - 0x32, 0x15, 0x13, 0xe3, 0x13, 0x68, 0xfc, 0xe7, 0x5b, 0x34, 0xfe, 0xd0, 0xa0, 0x73, 0x97, 0x10, - 0xef, 0x20, 0x0d,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, 0x70, 0xed, 0x8c, 0xd6, 0xd4, 0x58, 0x42, 0x77, 0xa0, 0x26, 0x5a, - 0x1e, 0xa4, 0x2b, 0xc6, 0xb9, 0x9e, 0x2e, 0xe7, 0x57, 0xbe, 0x3f, 0x32, 0x96, 0xd0, 0x43, 0x80, - 0xac, 0x69, 0x40, 0x2a, 0x2f, 0x73, 0x5d, 0xcb, 0xe0, 0xca, 0x09, 0xda, 0x14, 0xec, 0x4b, 0xe8, - 0xe6, 0xcb, 0x27, 0x1a, 0x2e, 0xac, 0x90, 0x4a, 0x0c, 0x0d, 0xae, 0x9f, 0x62, 0x91, 0x02, 0x7f, - 0x0d, 0xbd, 0x62, 0x55, 0x44, 0xc6, 0xc2, 0x85, 0xb9, 0x0a, 0x3b, 0xb8, 0x71, 0xaa, 0x8d, 0x4a, - 0x42, 0x16, 0xc6, 0x39, 0x12, 0xe6, 0x62, 0x3e, 0x47, 0xc2, 0x7c, 0xec, 0x1b, 0x4b, 0x7b, 0x35, - 0xfe, 0x17, 0xf0, 0xa3, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x18, 0x87, 0x1e, 0x54, 0x15, 0x14, - 0x00, 0x00, + // 1594 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xd4, 0x58, 0x4f, 0x6f, 0xdb, 0xc6, + 0x12, 0x37, 0xf5, 0xcf, 0xd2, 0xe8, 0x8f, 0xa5, 0xb5, 0x93, 0x30, 0xca, 0x4b, 0xa2, 0x30, 0x17, + 0x25, 0xef, 0x3d, 0xbf, 0x3c, 0xf7, 0xd0, 0x43, 0x5b, 0x04, 0x89, 0xe3, 0xb4, 0x46, 0x9c, 0xc4, + 0xa1, 0x92, 0x14, 0x28, 0x50, 0xb0, 0x14, 0xb9, 0x76, 0x08, 0x53, 0x24, 0xcb, 0x5d, 0x39, 0x56, + 0x2e, 0x3d, 0xb4, 0xc7, 0xa2, 0x97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8, 0xe4, 0xcb, 0x27, 0x1a, 0x2c, 0xac, 0x90, 0x4a, + 0x0c, 0xf5, 0x6f, 0x9c, 0x61, 0x91, 0x02, 0x7f, 0x09, 0xdd, 0x62, 0x55, 0x44, 0xc6, 0xc2, 0x85, + 0xb9, 0x0a, 0xdb, 0xbf, 0x79, 0xa6, 0x8d, 0x4a, 0x42, 0x16, 0xc6, 0x39, 0x12, 0xe6, 0x62, 0x3e, + 0x47, 0xc2, 0x7c, 0xec, 0x1b, 0x2b, 0xe3, 0x1a, 0xff, 0x1d, 0xf8, 0xc1, 0xdf, 0x01, 0x00, 0x00, + 0xff, 0xff, 0xf2, 0x26, 0x88, 0x39, 0x1e, 0x14, 0x00, 0x00, } diff --git a/weed/server/volume_grpc_client_to_master.go b/weed/server/volume_grpc_client_to_master.go index 6364cbc10..571c5716c 100644 --- a/weed/server/volume_grpc_client_to_master.go +++ b/weed/server/volume_grpc_client_to_master.go @@ -6,6 +6,7 @@ import ( "time" "github.com/chrislusf/seaweedfs/weed/security" + "github.com/chrislusf/seaweedfs/weed/storage/erasure_coding" "github.com/spf13/viper" "google.golang.org/grpc" @@ -121,7 +122,8 @@ func (vs *VolumeServer) doHeartbeat(ctx context.Context, masterNode, masterGrpcA &ecShardMessage, }, } - glog.V(1).Infof("volume server %s:%d adds ec shard %d:%d", vs.store.Ip, vs.store.Port, ecShardMessage.Id, ecShardMessage.EcIndex) + glog.V(1).Infof("volume server %s:%d adds ec shard %d:%d", vs.store.Ip, vs.store.Port, ecShardMessage.Id, + erasure_coding.ShardBits(ecShardMessage.EcIndexBits).ShardIds()) if err = stream.Send(deltaBeat); err != nil { glog.V(0).Infof("Volume Server Failed to update to master %s: %v", masterNode, err) return "", err @@ -143,7 +145,8 @@ func (vs *VolumeServer) doHeartbeat(ctx context.Context, masterNode, masterGrpcA &ecShardMessage, }, } - glog.V(1).Infof("volume server %s:%d deletes ec shard %d:%d", vs.store.Ip, vs.store.Port, ecShardMessage.Id, ecShardMessage.EcIndex) + glog.V(1).Infof("volume server %s:%d deletes ec shard %d:%d", vs.store.Ip, vs.store.Port, ecShardMessage.Id, + erasure_coding.ShardBits(ecShardMessage.EcIndexBits).ShardIds()) if err = stream.Send(deltaBeat); err != nil { glog.V(0).Infof("Volume Server Failed to update to master %s: %v", masterNode, err) return "", err diff --git a/weed/shell/command_volume_list.go b/weed/shell/command_volume_list.go index 171f862c9..a402c1e51 100644 --- a/weed/shell/command_volume_list.go +++ b/weed/shell/command_volume_list.go @@ -4,6 +4,8 @@ import ( "context" "fmt" "github.com/chrislusf/seaweedfs/weed/pb/master_pb" + "github.com/chrislusf/seaweedfs/weed/storage/erasure_coding" + "io" "sort" ) @@ -89,7 +91,7 @@ func writeDataNodeInfo(writer io.Writer, t *master_pb.DataNodeInfo) statistics { s = s.plus(writeVolumeInformationMessage(writer, vi)) } for _, ecShardInfo := range t.EcShardInfos { - fmt.Fprintf(writer, " ec %+v \n", ecShardInfo) + fmt.Fprintf(writer, " ec volume id:%v collection:%v shards:%v\n", ecShardInfo.Id, ecShardInfo.Collection, erasure_coding.ShardBits(ecShardInfo.EcIndexBits).ShardIds()) } fmt.Fprintf(writer, " DataNode %s %+v \n", t.Id, s) return s diff --git a/weed/storage/erasure_coding/ec_volume.go b/weed/storage/erasure_coding/ec_volume.go index b6ba2c8aa..f10f62135 100644 --- a/weed/storage/erasure_coding/ec_volume.go +++ b/weed/storage/erasure_coding/ec_volume.go @@ -2,8 +2,10 @@ package erasure_coding import ( "fmt" + "math" "os" "path" + "sort" "strconv" "github.com/chrislusf/seaweedfs/weed/pb/master_pb" @@ -44,6 +46,10 @@ func (shards *EcVolumeShards) AddEcVolumeShard(ecVolumeShard *EcVolumeShard) boo } } *shards = append(*shards, ecVolumeShard) + sort.Slice(shards, func(i, j int) bool { + return (*shards)[i].VolumeId < (*shards)[j].VolumeId || + (*shards)[i].VolumeId == (*shards)[j].VolumeId && (*shards)[i].ShardId < (*shards)[j].ShardId + }) return true } @@ -68,14 +74,19 @@ func (shards *EcVolumeShards) Close() { } } -func (shards *EcVolumeShards) ToVolumeInformationMessage() (messages []*master_pb.VolumeEcShardInformationMessage) { +func (shards *EcVolumeShards) ToVolumeEcShardInformationMessage() (messages []*master_pb.VolumeEcShardInformationMessage) { + prevVolumeId := needle.VolumeId(math.MaxUint32) + var m *master_pb.VolumeEcShardInformationMessage for _, s := range *shards { - m := &master_pb.VolumeEcShardInformationMessage{ - Id: uint32(s.VolumeId), - Collection: s.Collection, - EcIndex: uint32(s.ShardId), + if s.VolumeId != prevVolumeId { + m = &master_pb.VolumeEcShardInformationMessage{ + Id: uint32(s.VolumeId), + Collection: s.Collection, + } + messages = append(messages, m) } - messages = append(messages, m) + prevVolumeId = s.VolumeId + m.EcIndexBits = uint32(ShardBits(m.EcIndexBits).AddShardId(s.ShardId)) } return } diff --git a/weed/storage/erasure_coding/ec_volume_info.go b/weed/storage/erasure_coding/ec_volume_info.go index cefc95173..c26269158 100644 --- a/weed/storage/erasure_coding/ec_volume_info.go +++ b/weed/storage/erasure_coding/ec_volume_info.go @@ -1,8 +1,6 @@ package erasure_coding import ( - "fmt" - "github.com/chrislusf/seaweedfs/weed/pb/master_pb" "github.com/chrislusf/seaweedfs/weed/storage/needle" ) @@ -11,59 +9,74 @@ import ( type EcVolumeInfo struct { VolumeId needle.VolumeId Collection string - shardIds uint16 // use bits to indicate the shard id + ShardBits ShardBits } -func NewEcVolumeInfo(collection string, vid needle.VolumeId) *EcVolumeInfo { +func NewEcVolumeInfo(collection string, vid needle.VolumeId, shardBits ShardBits) *EcVolumeInfo { return &EcVolumeInfo{ Collection: collection, VolumeId: vid, + ShardBits: shardBits, } } func (ecInfo *EcVolumeInfo) AddShardId(id ShardId) { - ecInfo.shardIds |= (1 << id) + ecInfo.ShardBits = ecInfo.ShardBits.AddShardId(id) } func (ecInfo *EcVolumeInfo) RemoveShardId(id ShardId) { - ecInfo.shardIds &^= (1 << id) + ecInfo.ShardBits = ecInfo.ShardBits.RemoveShardId(id) } func (ecInfo *EcVolumeInfo) HasShardId(id ShardId) bool { - return ecInfo.shardIds&(1< 0 + return ecInfo.ShardBits.HasShardId(id) } func (ecInfo *EcVolumeInfo) ShardIds() (ret []ShardId) { - for i := ShardId(0); i < DataShardsCount+ParityShardsCount; i++ { - if ecInfo.HasShardId(i) { - ret = append(ret, i) - } - } - return + return ecInfo.ShardBits.ShardIds() } func (ecInfo *EcVolumeInfo) Minus(other *EcVolumeInfo) (*EcVolumeInfo) { ret := &EcVolumeInfo{ VolumeId: ecInfo.VolumeId, Collection: ecInfo.Collection, - shardIds: ecInfo.shardIds &^ other.shardIds, + ShardBits: ecInfo.ShardBits.Minus(other.ShardBits), } return ret } -func (ecInfo *EcVolumeInfo) ToVolumeEcShardInformationMessage() (ret []*master_pb.VolumeEcShardInformationMessage) { - for _, shard := range ecInfo.ShardIds() { - ret = append(ret, &master_pb.VolumeEcShardInformationMessage{ - Id: uint32(ecInfo.VolumeId), - EcIndex: uint32(shard), - Collection: ecInfo.Collection, - }) +func (ecInfo *EcVolumeInfo) ToVolumeEcShardInformationMessage() (ret *master_pb.VolumeEcShardInformationMessage) { + return &master_pb.VolumeEcShardInformationMessage{ + Id: uint32(ecInfo.VolumeId), + EcIndexBits: uint32(ecInfo.ShardBits), + Collection: ecInfo.Collection, + } +} +type ShardBits uint32 // use bits to indicate the shard id, use 32 bits just for possible future extension + +func (b ShardBits) AddShardId(id ShardId) ShardBits { + return b | (1 << id) +} + +func (b ShardBits) RemoveShardId(id ShardId) ShardBits { + return b &^ (1 << id) +} + +func (b ShardBits) HasShardId(id ShardId) bool { + return b&(1< 0 +} + +func (b ShardBits) ShardIds() (ret []ShardId) { + for i := ShardId(0); i < DataShardsCount+ParityShardsCount; i++ { + if b.HasShardId(i) { + ret = append(ret, i) + } } return } -func (ecInfo *EcVolumeInfo) String() string { - return fmt.Sprintf("id:%d shard:%v collection:%v", ecInfo.VolumeId, ecInfo.ShardIds(), ecInfo.Collection) +func (b ShardBits) Minus(other ShardBits) (ShardBits) { + return b &^ other } diff --git a/weed/storage/store_ec.go b/weed/storage/store_ec.go index 43d851faa..241adb24e 100644 --- a/weed/storage/store_ec.go +++ b/weed/storage/store_ec.go @@ -9,7 +9,7 @@ func (s *Store) CollectErasureCodingHeartbeat() *master_pb.Heartbeat { for _, location := range s.Locations { location.ecShardsLock.RLock() for _, ecShards := range location.ecShards { - ecShardMessages = append(ecShardMessages, ecShards.ToVolumeInformationMessage()...) + ecShardMessages = append(ecShardMessages, ecShards.ToVolumeEcShardInformationMessage()...) } location.ecShardsLock.RUnlock() } diff --git a/weed/topology/data_node.go b/weed/topology/data_node.go index dba323518..5edc9c580 100644 --- a/weed/topology/data_node.go +++ b/weed/topology/data_node.go @@ -164,7 +164,7 @@ func (dn *DataNode) ToDataNodeInfo() *master_pb.DataNodeInfo { m.VolumeInfos = append(m.VolumeInfos, v.ToVolumeInformationMessage()) } for _, ecv := range dn.GetEcShards() { - m.EcShardInfos = append(m.EcShardInfos, ecv.ToVolumeEcShardInformationMessage()...) + m.EcShardInfos = append(m.EcShardInfos, ecv.ToVolumeEcShardInformationMessage()) } return m } diff --git a/weed/topology/topology_ec.go b/weed/topology/topology_ec.go index 379440684..eb52b44b4 100644 --- a/weed/topology/topology_ec.go +++ b/weed/topology/topology_ec.go @@ -1,9 +1,6 @@ package topology import ( - "math" - "sort" - "github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/pb/master_pb" "github.com/chrislusf/seaweedfs/weed/storage/erasure_coding" @@ -20,18 +17,12 @@ type EcShardLocations struct { func (t *Topology) SyncDataNodeEcShards(shardInfos []*master_pb.VolumeEcShardInformationMessage, dn *DataNode) (newShards, deletedShards []*erasure_coding.EcVolumeInfo) { // convert into in memory struct storage.VolumeInfo var shards []*erasure_coding.EcVolumeInfo - sort.Slice(shardInfos, func(i, j int) bool { - return shardInfos[i].Id < shardInfos[j].Id - }) - prevVolumeId := uint32(math.MaxUint32) - var ecVolumeInfo *erasure_coding.EcVolumeInfo for _, shardInfo := range shardInfos { - if shardInfo.Id != prevVolumeId { - ecVolumeInfo = erasure_coding.NewEcVolumeInfo(shardInfo.Collection, needle.VolumeId(shardInfo.Id)) - shards = append(shards, ecVolumeInfo) - } - prevVolumeId = shardInfo.Id - ecVolumeInfo.AddShardId(erasure_coding.ShardId(shardInfo.EcIndex)) + shards = append(shards, + erasure_coding.NewEcVolumeInfo( + shardInfo.Collection, + needle.VolumeId(shardInfo.Id), + erasure_coding.ShardBits(shardInfo.EcIndexBits))) } // find out the delta volumes newShards, deletedShards = dn.UpdateEcShards(shards)