Browse Source

fix delete chunk failed if volumeSever specified grpc.port (#5820)

Co-authored-by: Yang Wang <yangwang@weride.ai>
revert-5819-patch-1
wyang 5 months ago
committed by GitHub
parent
commit
0581ce6096
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      weed/filer/filer_deletion.go
  2. 4
      weed/server/master_grpc_server_volume.go
  3. 13
      weed/server/master_server_handlers.go

6
weed/filer/filer_deletion.go

@ -1,11 +1,12 @@
package filer package filer
import ( import (
"github.com/seaweedfs/seaweedfs/weed/storage"
"github.com/seaweedfs/seaweedfs/weed/util"
"strings" "strings"
"time" "time"
"github.com/seaweedfs/seaweedfs/weed/storage"
"github.com/seaweedfs/seaweedfs/weed/util"
"github.com/seaweedfs/seaweedfs/weed/glog" "github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/operation" "github.com/seaweedfs/seaweedfs/weed/operation"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb" "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
@ -22,6 +23,7 @@ func LookupByMasterClientFn(masterClient *wdclient.MasterClient) func(vids []str
locations = append(locations, operation.Location{ locations = append(locations, operation.Location{
Url: loc.Url, Url: loc.Url,
PublicUrl: loc.PublicUrl, PublicUrl: loc.PublicUrl,
GrpcPort: loc.GrpcPort,
}) })
} }
m[vid] = &operation.LookupResult{ m[vid] = &operation.LookupResult{

4
weed/server/master_grpc_server_volume.go

@ -3,13 +3,14 @@ package weed_server
import ( import (
"context" "context"
"fmt" "fmt"
"github.com/seaweedfs/seaweedfs/weed/topology"
"math/rand" "math/rand"
"reflect" "reflect"
"strings" "strings"
"sync" "sync"
"time" "time"
"github.com/seaweedfs/seaweedfs/weed/topology"
"github.com/seaweedfs/raft" "github.com/seaweedfs/raft"
"github.com/seaweedfs/seaweedfs/weed/glog" "github.com/seaweedfs/seaweedfs/weed/glog"
@ -115,6 +116,7 @@ func (ms *MasterServer) LookupVolume(ctx context.Context, req *master_pb.LookupV
Url: loc.Url, Url: loc.Url,
PublicUrl: loc.PublicUrl, PublicUrl: loc.PublicUrl,
DataCenter: loc.DataCenter, DataCenter: loc.DataCenter,
GrpcPort: uint32(loc.GrpcPort),
}) })
} }
var auth string var auth string

13
weed/server/master_server_handlers.go

@ -2,12 +2,13 @@ package weed_server
import ( import (
"fmt" "fmt"
"github.com/seaweedfs/seaweedfs/weed/glog"
"net/http" "net/http"
"strconv" "strconv"
"strings" "strings"
"time" "time"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/operation" "github.com/seaweedfs/seaweedfs/weed/operation"
"github.com/seaweedfs/seaweedfs/weed/security" "github.com/seaweedfs/seaweedfs/weed/security"
"github.com/seaweedfs/seaweedfs/weed/stats" "github.com/seaweedfs/seaweedfs/weed/stats"
@ -74,7 +75,10 @@ func (ms *MasterServer) findVolumeLocation(collection, vid string) operation.Loo
machines := ms.Topo.Lookup(collection, volumeId) machines := ms.Topo.Lookup(collection, volumeId)
for _, loc := range machines { for _, loc := range machines {
locations = append(locations, operation.Location{ locations = append(locations, operation.Location{
Url: loc.Url(), PublicUrl: loc.PublicUrl, DataCenter: loc.GetDataCenterId(),
Url: loc.Url(),
PublicUrl: loc.PublicUrl,
DataCenter: loc.GetDataCenterId(),
GrpcPort: loc.GrpcPort,
}) })
} }
} }
@ -82,7 +86,10 @@ func (ms *MasterServer) findVolumeLocation(collection, vid string) operation.Loo
machines, getVidLocationsErr := ms.MasterClient.GetVidLocations(vid) machines, getVidLocationsErr := ms.MasterClient.GetVidLocations(vid)
for _, loc := range machines { for _, loc := range machines {
locations = append(locations, operation.Location{ locations = append(locations, operation.Location{
Url: loc.Url, PublicUrl: loc.PublicUrl, DataCenter: loc.DataCenter,
Url: loc.Url,
PublicUrl: loc.PublicUrl,
DataCenter: loc.DataCenter,
GrpcPort: loc.GrpcPort,
}) })
} }
err = getVidLocationsErr err = getVidLocationsErr

Loading…
Cancel
Save