Browse Source

replication healthy check and repair

pull/933/head
stlpmo-jn 7 years ago
parent
commit
ce73e53d8c
  1. 3
      weed/pb/master.proto
  2. 34
      weed/pb/master_pb/master.pb.go
  3. 2
      weed/server/volume_grpc_copy.go

3
weed/pb/master.proto

@ -165,6 +165,8 @@ message DataNodeInfo {
uint64 free_volume_count = 4; uint64 free_volume_count = 4;
uint64 active_volume_count = 5; uint64 active_volume_count = 5;
repeated VolumeInformationMessage volume_infos = 6; repeated VolumeInformationMessage volume_infos = 6;
string url = 7;
string public_url = 8;
} }
message RackInfo { message RackInfo {
string id = 1; string id = 1;
@ -189,6 +191,7 @@ message TopologyInfo {
uint64 free_volume_count = 4; uint64 free_volume_count = 4;
uint64 active_volume_count = 5; uint64 active_volume_count = 5;
repeated DataCenterInfo data_center_infos = 6; repeated DataCenterInfo data_center_infos = 6;
uint64 volume_size_limit_bytes = 7;
} }
message VolumeListRequest { message VolumeListRequest {
} }

34
weed/pb/master_pb/master.pb.go

@ -38,13 +38,13 @@ It has these top-level messages:
*/ */
package master_pb package master_pb
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import "github.com/golang/protobuf/proto"
import "fmt"
import "math"
import ( import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
"golang.org/x/net/context"
"google.golang.org/grpc"
) )
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
@ -793,6 +793,8 @@ type DataNodeInfo struct {
FreeVolumeCount uint64 `protobuf:"varint,4,opt,name=free_volume_count,json=freeVolumeCount" json:"free_volume_count,omitempty"` FreeVolumeCount uint64 `protobuf:"varint,4,opt,name=free_volume_count,json=freeVolumeCount" json:"free_volume_count,omitempty"`
ActiveVolumeCount uint64 `protobuf:"varint,5,opt,name=active_volume_count,json=activeVolumeCount" json:"active_volume_count,omitempty"` ActiveVolumeCount uint64 `protobuf:"varint,5,opt,name=active_volume_count,json=activeVolumeCount" json:"active_volume_count,omitempty"`
VolumeInfos []*VolumeInformationMessage `protobuf:"bytes,6,rep,name=volume_infos,json=volumeInfos" json:"volume_infos,omitempty"` VolumeInfos []*VolumeInformationMessage `protobuf:"bytes,6,rep,name=volume_infos,json=volumeInfos" json:"volume_infos,omitempty"`
Url string `protobuf:"bytes,7,opt,name=url" json:"url,omitempty"`
PublicUrl string `protobuf:"bytes,8,opt,name=public_url,json=publicUrl" json:"public_url,omitempty"`
} }
func (m *DataNodeInfo) Reset() { *m = DataNodeInfo{} } func (m *DataNodeInfo) Reset() { *m = DataNodeInfo{} }
@ -842,6 +844,20 @@ func (m *DataNodeInfo) GetVolumeInfos() []*VolumeInformationMessage {
return nil return nil
} }
func (m *DataNodeInfo) GetUrl() string {
if m != nil {
return m.Url
}
return ""
}
func (m *DataNodeInfo) GetPublicUrl() string {
if m != nil {
return m.PublicUrl
}
return ""
}
type RackInfo struct { type RackInfo struct {
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
VolumeCount uint64 `protobuf:"varint,2,opt,name=volume_count,json=volumeCount" json:"volume_count,omitempty"` VolumeCount uint64 `protobuf:"varint,2,opt,name=volume_count,json=volumeCount" json:"volume_count,omitempty"`
@ -961,6 +977,7 @@ type TopologyInfo struct {
FreeVolumeCount uint64 `protobuf:"varint,4,opt,name=free_volume_count,json=freeVolumeCount" json:"free_volume_count,omitempty"` FreeVolumeCount uint64 `protobuf:"varint,4,opt,name=free_volume_count,json=freeVolumeCount" json:"free_volume_count,omitempty"`
ActiveVolumeCount uint64 `protobuf:"varint,5,opt,name=active_volume_count,json=activeVolumeCount" json:"active_volume_count,omitempty"` ActiveVolumeCount uint64 `protobuf:"varint,5,opt,name=active_volume_count,json=activeVolumeCount" json:"active_volume_count,omitempty"`
DataCenterInfos []*DataCenterInfo `protobuf:"bytes,6,rep,name=data_center_infos,json=dataCenterInfos" json:"data_center_infos,omitempty"` DataCenterInfos []*DataCenterInfo `protobuf:"bytes,6,rep,name=data_center_infos,json=dataCenterInfos" json:"data_center_infos,omitempty"`
VolumeSizeLimitBytes uint64 `protobuf:"varint,7,opt,name=volume_size_limit_bytes,json=volumeSizeLimitBytes" json:"volume_size_limit_bytes,omitempty"`
} }
func (m *TopologyInfo) Reset() { *m = TopologyInfo{} } func (m *TopologyInfo) Reset() { *m = TopologyInfo{} }
@ -1010,6 +1027,13 @@ func (m *TopologyInfo) GetDataCenterInfos() []*DataCenterInfo {
return nil return nil
} }
func (m *TopologyInfo) GetVolumeSizeLimitBytes() uint64 {
if m != nil {
return m.VolumeSizeLimitBytes
}
return 0
}
type VolumeListRequest struct { type VolumeListRequest struct {
} }

2
weed/server/volume_grpc_copy.go

@ -92,7 +92,7 @@ func (vs *VolumeServer) VolumeCopy(ctx context.Context, req *volume_server_pb.Vo
return nil, err return nil, err
} }
if err = checkCopyFiles(volFileInfoResp, idxFileName, datFileName); err != nil { // added by panyc16
if err = checkCopyFiles(volFileInfoResp, idxFileName, datFileName); err != nil {
return nil, err return nil, err
} }

Loading…
Cancel
Save