mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-08-20 09:17:35 +08:00
follow grow volume option version
This commit is contained in:
parent
2f1b3d68d7
commit
da728750be
@ -60,6 +60,7 @@ func (ms *MasterServer) Assign(ctx context.Context, req *master_pb.AssignRequest
|
|||||||
}
|
}
|
||||||
diskType := types.ToDiskType(req.DiskType)
|
diskType := types.ToDiskType(req.DiskType)
|
||||||
|
|
||||||
|
ver := needle.GetCurrentVersion()
|
||||||
option := &topology.VolumeGrowOption{
|
option := &topology.VolumeGrowOption{
|
||||||
Collection: req.Collection,
|
Collection: req.Collection,
|
||||||
ReplicaPlacement: replicaPlacement,
|
ReplicaPlacement: replicaPlacement,
|
||||||
@ -70,7 +71,7 @@ func (ms *MasterServer) Assign(ctx context.Context, req *master_pb.AssignRequest
|
|||||||
Rack: req.Rack,
|
Rack: req.Rack,
|
||||||
DataNode: req.DataNode,
|
DataNode: req.DataNode,
|
||||||
MemoryMapMaxSizeMb: req.MemoryMapMaxSizeMb,
|
MemoryMapMaxSizeMb: req.MemoryMapMaxSizeMb,
|
||||||
Version: uint32(needle.GetCurrentVersion()),
|
Version: uint32(ver),
|
||||||
}
|
}
|
||||||
|
|
||||||
if !ms.Topo.DataCenterExists(option.DataCenter) {
|
if !ms.Topo.DataCenterExists(option.DataCenter) {
|
||||||
|
|||||||
@ -333,6 +333,8 @@ func (ms *MasterServer) VolumeGrow(ctx context.Context, req *master_pb.VolumeGro
|
|||||||
if req.DataCenter != "" && !ms.Topo.DataCenterExists(req.DataCenter) {
|
if req.DataCenter != "" && !ms.Topo.DataCenterExists(req.DataCenter) {
|
||||||
return nil, fmt.Errorf("data center not exists")
|
return nil, fmt.Errorf("data center not exists")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ver := needle.GetCurrentVersion()
|
||||||
volumeGrowOption := topology.VolumeGrowOption{
|
volumeGrowOption := topology.VolumeGrowOption{
|
||||||
Collection: req.Collection,
|
Collection: req.Collection,
|
||||||
ReplicaPlacement: replicaPlacement,
|
ReplicaPlacement: replicaPlacement,
|
||||||
@ -343,7 +345,7 @@ func (ms *MasterServer) VolumeGrow(ctx context.Context, req *master_pb.VolumeGro
|
|||||||
Rack: req.Rack,
|
Rack: req.Rack,
|
||||||
DataNode: req.DataNode,
|
DataNode: req.DataNode,
|
||||||
MemoryMapMaxSizeMb: req.MemoryMapMaxSizeMb,
|
MemoryMapMaxSizeMb: req.MemoryMapMaxSizeMb,
|
||||||
Version: uint32(needle.GetCurrentVersion()),
|
Version: uint32(ver),
|
||||||
}
|
}
|
||||||
volumeGrowRequest := topology.VolumeGrowRequest{
|
volumeGrowRequest := topology.VolumeGrowRequest{
|
||||||
Option: &volumeGrowOption,
|
Option: &volumeGrowOption,
|
||||||
|
|||||||
@ -167,6 +167,7 @@ func (ms *MasterServer) getVolumeGrowOption(r *http.Request) (*topology.VolumeGr
|
|||||||
return nil, fmt.Errorf("Failed to parse int64 preallocate = %s: %v", r.FormValue("preallocate"), err)
|
return nil, fmt.Errorf("Failed to parse int64 preallocate = %s: %v", r.FormValue("preallocate"), err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ver := needle.GetCurrentVersion()
|
||||||
volumeGrowOption := &topology.VolumeGrowOption{
|
volumeGrowOption := &topology.VolumeGrowOption{
|
||||||
Collection: r.FormValue("collection"),
|
Collection: r.FormValue("collection"),
|
||||||
ReplicaPlacement: replicaPlacement,
|
ReplicaPlacement: replicaPlacement,
|
||||||
@ -177,7 +178,7 @@ func (ms *MasterServer) getVolumeGrowOption(r *http.Request) (*topology.VolumeGr
|
|||||||
Rack: r.FormValue("rack"),
|
Rack: r.FormValue("rack"),
|
||||||
DataNode: r.FormValue("dataNode"),
|
DataNode: r.FormValue("dataNode"),
|
||||||
MemoryMapMaxSizeMb: memoryMapMaxSizeMb,
|
MemoryMapMaxSizeMb: memoryMapMaxSizeMb,
|
||||||
Version: uint32(needle.GetCurrentVersion()),
|
Version: uint32(ver),
|
||||||
}
|
}
|
||||||
return volumeGrowOption, nil
|
return volumeGrowOption, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@ -264,7 +264,7 @@ func (vg *VolumeGrowth) grow(grpcDialOption grpc.DialOption, topo *Topology, vid
|
|||||||
Collection: option.Collection,
|
Collection: option.Collection,
|
||||||
ReplicaPlacement: option.ReplicaPlacement,
|
ReplicaPlacement: option.ReplicaPlacement,
|
||||||
Ttl: option.Ttl,
|
Ttl: option.Ttl,
|
||||||
Version: needle.GetCurrentVersion(),
|
Version: needle.Version(option.Version),
|
||||||
DiskType: option.DiskType.String(),
|
DiskType: option.DiskType.String(),
|
||||||
ModifiedAtSecond: time.Now().Unix(),
|
ModifiedAtSecond: time.Now().Unix(),
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user