diff --git a/weed/command/scaffold.go b/weed/command/scaffold.go index 7a988cdcf..6fa72c730 100644 --- a/weed/command/scaffold.go +++ b/weed/command/scaffold.go @@ -346,5 +346,12 @@ scripts = """ """ sleep_minutes = 17 # sleep minutes between each script execution +sequencer_type = memory # Choose [memory|etcd] type for storing the file id sequence + +# when sequencer.type = etcd, set listen client urls of etcd cluster that store file id sequence +# example : http://127.0.0.1:2379,http://127.0.0.1:2389 +sequencer_etcd_urls = http://127.0.0.1:2379 + + ` ) diff --git a/weed/operation/assign_file_id.go b/weed/operation/assign_file_id.go index 4c50eaa26..2971cddbb 100644 --- a/weed/operation/assign_file_id.go +++ b/weed/operation/assign_file_id.go @@ -11,13 +11,14 @@ import ( ) type VolumeAssignRequest struct { - Count uint64 - Replication string - Collection string - Ttl string - DataCenter string - Rack string - DataNode string + Count uint64 + Replication string + Collection string + Ttl string + DataCenter string + Rack string + DataNode string + WritableVolumeCount uint32 } type AssignResult struct { @@ -53,6 +54,7 @@ func Assign(server string, grpcDialOption grpc.DialOption, primaryRequest *Volum DataCenter: primaryRequest.DataCenter, Rack: primaryRequest.Rack, DataNode: primaryRequest.DataNode, + WritableVolumeCount: primaryRequest.WritableVolumeCount, } resp, grpcErr := masterClient.Assign(context.Background(), req) if grpcErr != nil { diff --git a/weed/pb/master.proto b/weed/pb/master.proto index 80231a2d8..f03b3a9ab 100644 --- a/weed/pb/master.proto +++ b/weed/pb/master.proto @@ -140,6 +140,7 @@ message AssignRequest { string rack = 6; string data_node = 7; uint32 memory_map_max_size_mb = 8; + uint32 Writable_volume_count = 9; } message AssignResponse { string fid = 1; diff --git a/weed/pb/master_pb/master.pb.go b/weed/pb/master_pb/master.pb.go index 880d39de5..e9fe8164c 100644 --- a/weed/pb/master_pb/master.pb.go +++ b/weed/pb/master_pb/master.pb.go @@ -648,14 +648,15 @@ func (m *Location) GetPublicUrl() string { } type AssignRequest struct { - Count uint64 `protobuf:"varint,1,opt,name=count" json:"count,omitempty"` - Replication string `protobuf:"bytes,2,opt,name=replication" json:"replication,omitempty"` - Collection string `protobuf:"bytes,3,opt,name=collection" json:"collection,omitempty"` - Ttl string `protobuf:"bytes,4,opt,name=ttl" json:"ttl,omitempty"` - DataCenter string `protobuf:"bytes,5,opt,name=data_center,json=dataCenter" json:"data_center,omitempty"` - Rack string `protobuf:"bytes,6,opt,name=rack" json:"rack,omitempty"` - DataNode string `protobuf:"bytes,7,opt,name=data_node,json=dataNode" json:"data_node,omitempty"` - MemoryMapMaxSizeMb uint32 `protobuf:"varint,8,opt,name=memory_map_max_size_mb,json=MemoryMapMaxSizeMb" json:"memory_map_max_size_mb,omitempty"` + Count uint64 `protobuf:"varint,1,opt,name=count" json:"count,omitempty"` + Replication string `protobuf:"bytes,2,opt,name=replication" json:"replication,omitempty"` + Collection string `protobuf:"bytes,3,opt,name=collection" json:"collection,omitempty"` + Ttl string `protobuf:"bytes,4,opt,name=ttl" json:"ttl,omitempty"` + DataCenter string `protobuf:"bytes,5,opt,name=data_center,json=dataCenter" json:"data_center,omitempty"` + Rack string `protobuf:"bytes,6,opt,name=rack" json:"rack,omitempty"` + DataNode string `protobuf:"bytes,7,opt,name=data_node,json=dataNode" json:"data_node,omitempty"` + MemoryMapMaxSizeMb uint32 `protobuf:"varint,8,opt,name=memory_map_max_size_mb,json=memoryMapMaxSizeMb" json:"memory_map_max_size_mb,omitempty"` + WritableVolumeCount uint32 `protobuf:"varint,9,opt,name=Writable_volume_count,json=WritableVolumeCount" json:"Writable_volume_count,omitempty"` } func (m *AssignRequest) Reset() { *m = AssignRequest{} } @@ -719,6 +720,13 @@ func (m *AssignRequest) GetMemoryMapMaxSizeMb() uint32 { return 0 } +func (m *AssignRequest) GetWritableVolumeCount() uint32 { + if m != nil { + return m.WritableVolumeCount + } + return 0 +} + type AssignResponse struct { Fid string `protobuf:"bytes,1,opt,name=fid" json:"fid,omitempty"` Url string `protobuf:"bytes,2,opt,name=url" json:"url,omitempty"` @@ -1809,125 +1817,127 @@ var _Seaweed_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("master.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1920 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xd4, 0x59, 0xcb, 0x6f, 0x1b, 0xc7, - 0x19, 0xf7, 0x92, 0x14, 0x45, 0x7e, 0x7c, 0x88, 0x1c, 0xc9, 0x0a, 0xcd, 0xd4, 0x16, 0xbd, 0x29, - 0x10, 0xc5, 0x4d, 0xd5, 0x54, 0x09, 0xd0, 0x02, 0x6d, 0x11, 0xd8, 0xb2, 0x92, 0x0a, 0xb6, 0x1c, - 0x7b, 0xe9, 0xba, 0x40, 0x81, 0x62, 0x3b, 0xdc, 0x1d, 0x49, 0x0b, 0xed, 0xab, 0x3b, 0x43, 0x99, - 0x4c, 0x8f, 0xed, 0xad, 0x40, 0x2f, 0x3d, 0xf4, 0xd4, 0x7b, 0xff, 0x86, 0x1e, 0x7a, 0xe9, 0x1f, - 0xd1, 0x73, 0xff, 0x85, 0x5e, 0x8b, 0xa2, 0xc1, 0xbc, 0x76, 0x67, 0x49, 0x4a, 0xb2, 0x02, 0xf8, - 0xe0, 0xdb, 0xec, 0xf7, 0x9a, 0x6f, 0x7e, 0xdf, 0x7c, 0x8f, 0x21, 0xa1, 0x1d, 0x61, 0xca, 0x48, - 0xb6, 0x97, 0x66, 0x09, 0x4b, 0x50, 0x53, 0x7e, 0xb9, 0xe9, 0xc4, 0xfe, 0x63, 0x1d, 0x9a, 0x3f, - 0x27, 0x38, 0x63, 0x13, 0x82, 0x19, 0xea, 0x42, 0x25, 0x48, 0x07, 0xd6, 0xc8, 0xda, 0x6d, 0x3a, - 0x95, 0x20, 0x45, 0x08, 0x6a, 0x69, 0x92, 0xb1, 0x41, 0x65, 0x64, 0xed, 0x76, 0x1c, 0xb1, 0x46, - 0x77, 0x01, 0xd2, 0xe9, 0x24, 0x0c, 0x3c, 0x77,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xa9, 0x77, 0x78, 0xf7, 0x12, 0x6e, 0x6e, 0xec, 0x97, 0xd0, 0x2d, 0x8f, 0x46, 0x68, - 0xb4, 0x72, 0xfa, 0x31, 0xea, 0xc3, 0xf0, 0xfe, 0x15, 0x12, 0xb9, 0xe1, 0x5f, 0x43, 0x6f, 0x71, - 0xe2, 0x41, 0xf6, 0x4a, 0xc5, 0xd2, 0xf4, 0x34, 0xfc, 0xe0, 0x4a, 0x19, 0x13, 0x84, 0xa2, 0x44, - 0x95, 0x40, 0x58, 0xaa, 0x67, 0x25, 0x10, 0x96, 0xeb, 0x9a, 0x04, 0xa1, 0x9c, 0xd7, 0x25, 0x10, - 0x56, 0x56, 0xa1, 0x12, 0x08, 0xab, 0x8b, 0x82, 0x7d, 0x0b, 0x25, 0xb0, 0xbd, 0x3a, 0xdb, 0x90, - 0xf9, 0xf3, 0xc8, 0x95, 0x29, 0x3b, 0xfc, 0xe8, 0x0d, 0x24, 0xf5, 0x86, 0x93, 0xba, 0xf8, 0x27, - 0xe1, 0xd3, 0x6f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x5c, 0xb0, 0xe7, 0x7c, 0x59, 0x18, 0x00, 0x00, + // 1943 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xd4, 0x59, 0x4b, 0x6f, 0x1b, 0xc9, + 0x11, 0xf6, 0x90, 0x14, 0x45, 0x16, 0x1f, 0x22, 0x5b, 0xb2, 0x96, 0xe6, 0xc6, 0x16, 0x3d, 0x1b, + 0x60, 0xb5, 0xce, 0x46, 0xd9, 0x68, 0x17, 0x48, 0x80, 0x24, 0x58, 0xd8, 0xb2, 0x76, 0x23, 0xd8, + 0xf2, 0xda, 0x43, 0xc7, 0x0b, 0x04, 0x08, 0x26, 0xcd, 0x99, 0x96, 0x34, 0xd0, 0xbc, 0x32, 0xdd, + 0x94, 0xc9, 0xcd, 0x31, 0xb9, 0x05, 0xc8, 0x25, 0x87, 0x9c, 0x72, 0xcf, 0x3d, 0xb7, 0x1c, 0x72, + 0xc9, 0x8f, 0xc8, 0x39, 0x7f, 0x21, 0xd7, 0x20, 0x40, 0xd0, 0xaf, 0x99, 0x1e, 0x92, 0x92, 0xac, + 0x05, 0x7c, 0xf0, 0x6d, 0xa6, 0xaa, 0xba, 0xba, 0xe6, 0xab, 0xae, 0xaa, 0xaf, 0x49, 0x68, 0x47, + 0x98, 0x32, 0x92, 0xed, 0xa5, 0x59, 0xc2, 0x12, 0xd4, 0x94, 0x6f, 0x6e, 0x3a, 0xb1, 0xff, 0x50, + 0x87, 0xe6, 0xcf, 0x09, 0xce, 0xd8, 0x84, 0x60, 0x86, 0xba, 0x50, 0x09, 0xd2, 0x81, 0x35, 0xb2, + 0x76, 0x9b, 0x4e, 0x25, 0x48, 0x11, 0x82, 0x5a, 0x9a, 0x64, 0x6c, 0x50, 0x19, 0x59, 0xbb, 0x1d, + 0x47, 0x3c, 0xa3, 0xbb, 0x00, 0xe9, 0x74, 0x12, 0x06, 0x9e, 0x3b, 0xcd, 0xc2, 0x41, 0x55, 0xd8, + 0x36, 0xa5, 0xe4, 0x17, 0x59, 0x88, 0x76, 0xa1, 0x17, 0xe1, 0x99, 0x7b, 0x91, 0x84, 0xd3, 0x88, + 0xb8, 0x5e, 0x32, 0x8d, 0xd9, 0xa0, 0x26, 0x96, 0x77, 0x23, 0x3c, 0x7b, 0x25, 0xc4, 0x07, 0x5c, + 0x8a, 0x46, 0x3c, 0xaa, 0x99, 0x7b, 0x12, 0x84, 0xc4, 0x3d, 0x27, 0xf3, 0xc1, 0xda, 0xc8, 0xda, + 0xad, 0x39, 0x10, 0xe1, 0xd9, 0x17, 0x41, 0x48, 0x9e, 0x90, 0x39, 0xda, 0x81, 0x96, 0x8f, 0x19, + 0x76, 0x3d, 0x12, 0x33, 0x92, 0x0d, 0xea, 0x62, 0x2f, 0xe0, 0xa2, 0x03, 0x21, 0xe1, 0xf1, 0x65, + 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 0xad, 0xdf, 0x87, 0x66, + 0x46, 0xb0, 0xef, 0x26, 0x71, 0x38, 0x17, 0x25, 0xde, 0x70, 0x1a, 0x5c, 0xf0, 0x55, 0x1c, 0xce, + 0xd1, 0xf7, 0xa0, 0x9f, 0x91, 0x34, 0x0c, 0x3c, 0xec, 0xa6, 0x21, 0xf6, 0x48, 0x44, 0x62, 0x5d, + 0xed, 0x3d, 0xa5, 0x78, 0xae, 0xe5, 0x68, 0x00, 0xeb, 0x17, 0x24, 0xa3, 0xfc, 0xb3, 0x9a, 0xc2, + 0x44, 0xbf, 0xa2, 0x1e, 0x54, 0x19, 0x0b, 0x07, 0x20, 0xa4, 0xfc, 0x11, 0x7d, 0x04, 0x3d, 0x2f, + 0x89, 0x52, 0xec, 0x31, 0x37, 0x23, 0x17, 0x81, 0x58, 0xd4, 0x12, 0xea, 0x0d, 0x25, 0x77, 0x94, + 0x98, 0x7f, 0x4e, 0x94, 0xf8, 0xc1, 0x49, 0x40, 0x7c, 0x17, 0x33, 0x95, 0x26, 0x51, 0x72, 0x55, + 0xa7, 0xa7, 0x35, 0x0f, 0x99, 0x4c, 0x90, 0xfd, 0x57, 0x0b, 0xee, 0x5e, 0x59, 0xce, 0x4b, 0x49, + 0xba, 0x2e, 0x21, 0x6f, 0x0b, 0x03, 0x7b, 0x0a, 0x3b, 0xd7, 0x14, 0xd9, 0x35, 0xb1, 0x56, 0x96, + 0x62, 0xb5, 0xa1, 0x43, 0x3c, 0x37, 0x88, 0x7d, 0x32, 0x73, 0x27, 0x01, 0x93, 0xc7, 0xbf, 0xe3, + 0xb4, 0x88, 0x77, 0xc4, 0x65, 0x8f, 0x02, 0x46, 0xed, 0x75, 0x58, 0x3b, 0x8c, 0x52, 0x36, 0xb7, + 0xff, 0x61, 0xc1, 0xc6, 0x78, 0x9a, 0x92, 0xec, 0x51, 0x98, 0x78, 0xe7, 0x87, 0x33, 0x96, 0x61, + 0xf4, 0x15, 0x74, 0x49, 0x86, 0xe9, 0x34, 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 0x02, 0x61, 0x75, 0x53, 0xb0, 0x6f, + 0xa1, 0x04, 0xb6, 0x57, 0x57, 0x1b, 0x32, 0x7f, 0x52, 0xb9, 0xb2, 0x64, 0x87, 0x1f, 0xbd, 0x81, + 0xa5, 0xde, 0x70, 0x52, 0x17, 0xff, 0x3e, 0x7c, 0xfa, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x44, + 0x05, 0x7a, 0xc2, 0x8d, 0x18, 0x00, 0x00, } diff --git a/weed/pb/volume_server_pb/volume_server.pb.go b/weed/pb/volume_server_pb/volume_server.pb.go index f8af827a6..24907cdba 100644 --- a/weed/pb/volume_server_pb/volume_server.pb.go +++ b/weed/pb/volume_server_pb/volume_server.pb.go @@ -320,7 +320,7 @@ type AllocateVolumeRequest struct { Preallocate int64 `protobuf:"varint,3,opt,name=preallocate" json:"preallocate,omitempty"` Replication string `protobuf:"bytes,4,opt,name=replication" json:"replication,omitempty"` Ttl string `protobuf:"bytes,5,opt,name=ttl" json:"ttl,omitempty"` - MemoryMapMaxSizeMb uint32 `protobuf:"varint,6,opt,name=memory_map_max_size_mb,json=MemoryMapMaxSizeMb" json:"memory_map_max_size_mb,omitempty"` + MemoryMapMaxSizeMb uint32 `protobuf:"varint,6,opt,name=memory_map_max_size_mb,json=memoryMapMaxSizeMb" json:"memory_map_max_size_mb,omitempty"` } func (m *AllocateVolumeRequest) Reset() { *m = AllocateVolumeRequest{} } diff --git a/weed/sequence/etcd_sequencer.go b/weed/sequence/etcd_sequencer.go new file mode 100644 index 000000000..1fc378640 --- /dev/null +++ b/weed/sequence/etcd_sequencer.go @@ -0,0 +1,296 @@ +package sequence + +/* +Note : +(1) store the sequence in the ETCD cluster, and local file(sequence.dat) +(2) batch get the sequences from ETCD cluster, and store the max sequence id in the local file +(3) the sequence range is : [currentSeqId, maxSeqId), when the currentSeqId >= maxSeqId, fetch the new maxSeqId. +*/ + +import ( + "context" + "fmt" + "sync" + "time" + + "io" + "os" + "strconv" + "strings" + + "github.com/chrislusf/seaweedfs/weed/glog" + "go.etcd.io/etcd/client" +) + +const ( + // EtcdKeyPrefix = "/seaweedfs" + EtcdKeySequence = "/master/sequence" + EtcdContextTimeoutSecond = 100 * time.Second + DefaultEtcdSteps uint64 = 500 // internal counter + SequencerFileName = "sequencer.dat" + FileMaxSequenceLength = 128 +) + +type EtcdSequencer struct { + sequenceLock sync.Mutex + + // available sequence range : [currentSeqId, maxSeqId) + currentSeqId uint64 + maxSeqId uint64 + + keysAPI client.KeysAPI + seqFile *os.File +} + +func NewEtcdSequencer(etcdUrls string, metaFolder string) (*EtcdSequencer, error) { + file, err := openSequenceFile(metaFolder + "/" + SequencerFileName) + if nil != err { + return nil, fmt.Errorf("open sequence file fialed, %v", err) + } + + cli, err := client.New(client.Config{ + Endpoints: strings.Split(etcdUrls, ","), + Username: "", + Password: "", + }) + if err != nil { + return nil, err + } + keysApi := client.NewKeysAPI(cli) + + // TODO: the current sequence id in local file is not used + maxValue, _, err := readSequenceFile(file) + if err != nil { + return nil, fmt.Errorf("read sequence from file failed, %v", err) + } + glog.V(4).Infof("read sequence from file : %d", maxValue) + + newSeq, err := setMaxSequenceToEtcd(keysApi, maxValue) + if err != nil { + return nil, err + } + + sequencer := &EtcdSequencer{maxSeqId: newSeq, + currentSeqId: newSeq, + keysAPI: keysApi, + seqFile: file, + } + return sequencer, nil +} + +func (es *EtcdSequencer) NextFileId(count uint64) uint64 { + es.sequenceLock.Lock() + defer es.sequenceLock.Unlock() + + if (es.currentSeqId + count) >= es.maxSeqId { + reqSteps := DefaultEtcdSteps + if count > DefaultEtcdSteps { + reqSteps += count + } + maxId, err := batchGetSequenceFromEtcd(es.keysAPI, reqSteps) + glog.V(4).Infof("get max sequence id from etcd, %d", maxId) + if err != nil { + glog.Error(err) + return 0 + } + es.currentSeqId, es.maxSeqId = maxId-reqSteps, maxId + glog.V(4).Infof("current id : %d, max id : %d", es.currentSeqId, es.maxSeqId) + + if err := writeSequenceFile(es.seqFile, es.maxSeqId, es.currentSeqId); err != nil { + glog.Errorf("flush sequence to file failed, %v", err) + } + } + + ret := es.currentSeqId + es.currentSeqId += count + return ret +} + +/** +instead of collecting the max value from volume server, +the max value should be saved in local config file and ETCD cluster +*/ +func (es *EtcdSequencer) SetMax(seenValue uint64) { + es.sequenceLock.Lock() + defer es.sequenceLock.Unlock() + if seenValue > es.maxSeqId { + maxId, err := setMaxSequenceToEtcd(es.keysAPI, seenValue) + if err != nil { + glog.Errorf("set Etcd Max sequence failed : %v", err) + return + } + es.currentSeqId, es.maxSeqId = maxId, maxId + + if err := writeSequenceFile(es.seqFile, maxId, maxId); err != nil { + glog.Errorf("flush sequence to file failed, %v", err) + } + } +} + +func (es *EtcdSequencer) GetMax() uint64 { + return es.maxSeqId +} + +func (es *EtcdSequencer) Peek() uint64 { + return es.currentSeqId +} + +func batchGetSequenceFromEtcd(kvApi client.KeysAPI, step uint64) (uint64, error) { + if step <= 0 { + return 0, fmt.Errorf("the step must be large than 1") + } + + ctx, cancel := context.WithTimeout(context.Background(), EtcdContextTimeoutSecond) + var endSeqValue uint64 = 0 + defer cancel() + for { + getResp, err := kvApi.Get(ctx, EtcdKeySequence, &client.GetOptions{Recursive: false, Quorum: true}) + if err != nil { + return 0, err + } + if getResp.Node == nil { + continue + } + + prevValue := getResp.Node.Value + prevSeqValue, err := strconv.ParseUint(prevValue, 10, 64) + if err != nil { + return 0, fmt.Errorf("get sequence from etcd failed, %v", err) + } + endSeqValue = prevSeqValue + step + endSeqStr := strconv.FormatUint(endSeqValue, 10) + + _, err = kvApi.Set(ctx, EtcdKeySequence, endSeqStr, &client.SetOptions{PrevValue: prevValue}) + if err == nil { + break + } + glog.Error(err) + } + + return endSeqValue, nil +} + +/** +update the value of the key EtcdKeySequence in ETCD cluster with the parameter of maxSeq, +when the value of the key EtcdKeySequence is equal to or large than the parameter maxSeq, +return the value of EtcdKeySequence in the ETCD cluster; +when the value of the EtcdKeySequence is less than the parameter maxSeq, +return the value of the parameter maxSeq +*/ +func setMaxSequenceToEtcd(kvApi client.KeysAPI, maxSeq uint64) (uint64, error) { + maxSeqStr := strconv.FormatUint(maxSeq, 10) + ctx, cancel := context.WithTimeout(context.Background(), EtcdContextTimeoutSecond) + defer cancel() + + for { + getResp, err := kvApi.Get(ctx, EtcdKeySequence, &client.GetOptions{Recursive: false, Quorum: true}) + if err != nil { + if ce, ok := err.(client.Error); ok && (ce.Code == client.ErrorCodeKeyNotFound) { + _, err := kvApi.Create(ctx, EtcdKeySequence, maxSeqStr) + if err == nil { + continue + } + if ce, ok = err.(client.Error); ok && (ce.Code == client.ErrorCodeNodeExist) { + continue + } + return 0, err + } else { + return 0, err + } + } + + if getResp.Node == nil { + continue + } + prevSeqStr := getResp.Node.Value + prevSeq, err := strconv.ParseUint(prevSeqStr, 10, 64) + if err != nil { + return 0, err + } + if prevSeq >= maxSeq { + return prevSeq, nil + } + + _, err = kvApi.Set(ctx, EtcdKeySequence, maxSeqStr, &client.SetOptions{PrevValue: prevSeqStr}) + if err != nil { + return 0, err + } + } +} + +func openSequenceFile(file string) (*os.File, error) { + _, err := os.Stat(file) + if os.IsNotExist(err) { + fid, err := os.OpenFile(file, os.O_RDWR|os.O_CREATE, 0644) + if err != nil { + return nil, err + } + if err := writeSequenceFile(fid, 1, 0); err != nil { + return nil, err + } + return fid, nil + } else { + return os.OpenFile(file, os.O_RDWR|os.O_CREATE, 0644) + } +} + +/* +read sequence and step from sequence file +*/ +func readSequenceFile(file *os.File) (uint64, uint64, error) { + sequence := make([]byte, FileMaxSequenceLength) + size, err := file.ReadAt(sequence, 0) + if (err != nil) && (err != io.EOF) { + err := fmt.Errorf("cannot read file %s, %v", file.Name(), err) + return 0, 0, err + } + sequence = sequence[0:size] + seqs := strings.Split(string(sequence), ":") + maxId, err := strconv.ParseUint(seqs[0], 10, 64) + if err != nil { + return 0, 0, fmt.Errorf("parse sequence from file failed, %v", err) + } + + if len(seqs) > 1 { + step, err := strconv.ParseUint(seqs[1], 10, 64) + if err != nil { + return 0, 0, fmt.Errorf("parse sequence from file failed, %v", err) + } + return maxId, step, nil + } + + return maxId, 0, nil +} + +/** +write the sequence and step to sequence file +*/ +func writeSequenceFile(file *os.File, sequence, step uint64) error { + _ = step + seqStr := fmt.Sprintf("%d:%d", sequence, sequence) + if _, err := file.Seek(0, 0); err != nil { + err = fmt.Errorf("cannot seek to the beginning of %s: %v", file.Name(), err) + return err + } + if err := file.Truncate(0); err != nil { + return fmt.Errorf("truncate sequence file faield : %v", err) + } + if _, err := file.WriteString(seqStr); err != nil { + return fmt.Errorf("write file %s failed, %v", file.Name(), err) + } + if err := file.Sync(); err != nil { + return fmt.Errorf("flush file %s failed, %v", file.Name(), err) + } + return nil +} + +// the UT helper method +// func deleteEtcdKey(kvApi client.KeysAPI, key string) error { +// ctx, cancel := context.WithTimeout(context.Background(), EtcdContextTimeoutSecond) +// defer cancel() +// _, err := kvApi.Delete(ctx, key, &client.DeleteOptions{Dir: false}) +// if err != nil { +// return err +// } +// return nil +// } diff --git a/weed/server/master_grpc_server_volume.go b/weed/server/master_grpc_server_volume.go index 0580acf76..8fc56e9b8 100644 --- a/weed/server/master_grpc_server_volume.go +++ b/weed/server/master_grpc_server_volume.go @@ -78,7 +78,7 @@ func (ms *MasterServer) Assign(ctx context.Context, req *master_pb.AssignRequest } ms.vgLock.Lock() if !ms.Topo.HasWritableVolume(option) { - if _, err = ms.vg.AutomaticGrowByType(option, ms.grpcDialOption, ms.Topo); err != nil { + if _, err = ms.vg.AutomaticGrowByType(option, ms.grpcDialOption, ms.Topo, int(req.WritableVolumeCount)); err != nil { ms.vgLock.Unlock() return nil, fmt.Errorf("Cannot grow volume group! %v", err) } diff --git a/weed/server/master_server.go b/weed/server/master_server.go index cde583560..15e6ee51c 100644 --- a/weed/server/master_server.go +++ b/weed/server/master_server.go @@ -27,6 +27,12 @@ import ( "google.golang.org/grpc" ) +const ( + MasterPrefix = "master.maintenance" + SequencerType = MasterPrefix + ".sequencer_type" + SequencerEtcdUrls = MasterPrefix + ".sequencer_etcd_urls" +) + type MasterOption struct { Port int MetaFolder string @@ -87,7 +93,11 @@ func NewMasterServer(r *mux.Router, option *MasterOption, peers []string) *Maste MasterClient: wdclient.NewMasterClient(context.Background(), grpcDialOption, "master", peers), } ms.bounedLeaderChan = make(chan int, 16) - seq := sequence.NewMemorySequencer() + + seq := ms.createSequencer(option) + if nil == seq { + glog.Fatalf("create sequencer failed.") + } ms.Topo = topology.NewTopology("topo", seq, uint64(ms.option.VolumeSizeLimitMB)*1024*1024, ms.option.PulseSeconds) ms.vg = topology.NewDefaultVolumeGrowth() glog.V(0).Infoln("Volume Size Limit is", ms.option.VolumeSizeLimitMB, "MB") @@ -165,8 +175,8 @@ func (ms *MasterServer) proxyToLeader(f func(w http.ResponseWriter, r *http.Requ proxy.Transport = util.Transport proxy.ServeHTTP(w, r) } else { - //drop it to the floor - //writeJsonError(w, r, errors.New(ms.Topo.RaftServer.Name()+" does not know Leader yet:"+ms.Topo.RaftServer.Leader())) + // drop it to the floor + // writeJsonError(w, r, errors.New(ms.Topo.RaftServer.Name()+" does not know Leader yet:"+ms.Topo.RaftServer.Leader())) } } } @@ -230,3 +240,25 @@ func (ms *MasterServer) startAdminScripts() { } }() } + +func (ms *MasterServer) createSequencer(option *MasterOption) sequence.Sequencer { + var seq sequence.Sequencer + seqType := strings.ToLower(util.Config().GetString(SequencerType)) + glog.V(0).Infof("[%s] : [%s]", SequencerType, seqType) + switch strings.ToLower(seqType) { + case "memory": + seq = sequence.NewMemorySequencer() + case "etcd": + var err error + urls := util.Config().GetString(SequencerEtcdUrls) + glog.V(0).Infof("[%s] : [%s]", SequencerEtcdUrls, urls) + seq, err = sequence.NewEtcdSequencer(urls, option.MetaFolder) + if err != nil { + glog.Error(err) + seq = nil + } + default: + seq = sequence.NewMemorySequencer() + } + return seq +} diff --git a/weed/server/master_server_handlers.go b/weed/server/master_server_handlers.go index 9bcd35ced..514d86800 100644 --- a/weed/server/master_server_handlers.go +++ b/weed/server/master_server_handlers.go @@ -100,6 +100,11 @@ func (ms *MasterServer) dirAssignHandler(w http.ResponseWriter, r *http.Request) requestedCount = 1 } + writableVolumeCount, e := strconv.Atoi(r.FormValue("writableVolumeCount")) + if e != nil { + writableVolumeCount = 0 + } + option, err := ms.getVolumeGrowOption(r) if err != nil { writeJsonQuiet(w, r, http.StatusNotAcceptable, operation.AssignResult{Error: err.Error()}) @@ -114,7 +119,7 @@ func (ms *MasterServer) dirAssignHandler(w http.ResponseWriter, r *http.Request) ms.vgLock.Lock() defer ms.vgLock.Unlock() if !ms.Topo.HasWritableVolume(option) { - if _, err = ms.vg.AutomaticGrowByType(option, ms.grpcDialOption, ms.Topo); err != nil { + if _, err = ms.vg.AutomaticGrowByType(option, ms.grpcDialOption, ms.Topo, writableVolumeCount); err != nil { writeJsonError(w, r, http.StatusInternalServerError, fmt.Errorf("Cannot grow volume group! %v", err)) return diff --git a/weed/shell/command_ec_balance.go b/weed/shell/command_ec_balance.go index 47ae7bad3..8bf993f4a 100644 --- a/weed/shell/command_ec_balance.go +++ b/weed/shell/command_ec_balance.go @@ -266,6 +266,10 @@ func doBalanceEcShardsAcrossRacks(ctx context.Context, commandEnv *CommandEnv, c for shardId, ecNode := range ecShardsToMove { rackId := pickOneRack(racks, rackToShardCount, averageShardsPerEcRack) + if rackId == "" { + fmt.Printf("ec shard %d.%d at %s can not find a destination rack\n", vid, shardId, ecNode.info.Id) + continue + } var possibleDestinationEcNodes []*EcNode for _, n := range racks[rackId].ecNodes { possibleDestinationEcNodes = append(possibleDestinationEcNodes, n) diff --git a/weed/shell/command_ec_common.go b/weed/shell/command_ec_common.go index d0fe16a68..1e9d96212 100644 --- a/weed/shell/command_ec_common.go +++ b/weed/shell/command_ec_common.go @@ -156,7 +156,7 @@ func countShards(ecShardInfos []*master_pb.VolumeEcShardInformationMessage) (cou } func countFreeShardSlots(dn *master_pb.DataNodeInfo) (count int) { - return int(dn.FreeVolumeCount)*10 - countShards(dn.EcShardInfos) + return int(dn.FreeVolumeCount)*erasure_coding.DataShardsCount - countShards(dn.EcShardInfos) } type RackId string diff --git a/weed/topology/volume_growth.go b/weed/topology/volume_growth.go index f21ab45ef..636eb2260 100644 --- a/weed/topology/volume_growth.go +++ b/weed/topology/volume_growth.go @@ -59,8 +59,11 @@ func (vg *VolumeGrowth) findVolumeCount(copyCount int) (count int) { return } -func (vg *VolumeGrowth) AutomaticGrowByType(option *VolumeGrowOption, grpcDialOption grpc.DialOption, topo *Topology) (count int, err error) { - count, err = vg.GrowByCountAndType(grpcDialOption, vg.findVolumeCount(option.ReplicaPlacement.GetCopyCount()), option, topo) +func (vg *VolumeGrowth) AutomaticGrowByType(option *VolumeGrowOption, grpcDialOption grpc.DialOption, topo *Topology, targetCount int) (count int, err error) { + if targetCount == 0 { + targetCount = vg.findVolumeCount(option.ReplicaPlacement.GetCopyCount()) + } + count, err = vg.GrowByCountAndType(grpcDialOption, targetCount, option, topo) if count > 0 && count%option.ReplicaPlacement.GetCopyCount() == 0 { return count, nil } diff --git a/weed/util/config.go b/weed/util/config.go index 1ea833d1f..7e2f9b373 100644 --- a/weed/util/config.go +++ b/weed/util/config.go @@ -40,5 +40,9 @@ func LoadConfiguration(configFileName string, required bool) (loaded bool) { } return true - } + +func Config() Configuration { + return viper.GetViper() +} +