add version to volume proto

This commit is contained in:
chrislu
2025-06-16 22:05:06 -07:00
parent 11f37cd9f2
commit 96632a34b1
26 changed files with 4750 additions and 11102 deletions

View File

@@ -3,11 +3,12 @@ package weed_server
import (
"context"
"fmt"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/stats"
"strings"
"time"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/stats"
"github.com/seaweedfs/raft"
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
@@ -69,6 +70,7 @@ func (ms *MasterServer) Assign(ctx context.Context, req *master_pb.AssignRequest
Rack: req.Rack,
DataNode: req.DataNode,
MemoryMapMaxSizeMb: req.MemoryMapMaxSizeMb,
Version: uint32(needle.CurrentVersion),
}
if !ms.Topo.DataCenterExists(option.DataCenter) {

View File

@@ -343,6 +343,7 @@ func (ms *MasterServer) VolumeGrow(ctx context.Context, req *master_pb.VolumeGro
Rack: req.Rack,
DataNode: req.DataNode,
MemoryMapMaxSizeMb: req.MemoryMapMaxSizeMb,
Version: uint32(needle.CurrentVersion),
}
volumeGrowRequest := topology.VolumeGrowRequest{
Option: &volumeGrowOption,

View File

@@ -3,11 +3,12 @@ package weed_server
import (
"context"
"fmt"
"github.com/seaweedfs/seaweedfs/weed/util/version"
"math/rand/v2"
"net/http"
"strconv"
"github.com/seaweedfs/seaweedfs/weed/util/version"
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
@@ -176,6 +177,7 @@ func (ms *MasterServer) getVolumeGrowOption(r *http.Request) (*topology.VolumeGr
Rack: r.FormValue("rack"),
DataNode: r.FormValue("dataNode"),
MemoryMapMaxSizeMb: memoryMapMaxSizeMb,
Version: uint32(needle.CurrentVersion),
}
return volumeGrowOption, nil
}

View File

@@ -310,6 +310,7 @@ func (vs *VolumeServer) ReadVolumeFileStatus(ctx context.Context, req *volume_se
resp.Collection = v.Collection
resp.DiskType = string(v.DiskType())
resp.VolumeInfo = v.GetVolumeInfo()
resp.Version = uint32(v.Version())
return resp, nil
}