aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwyang <wings.wyang@gmail.com>2024-07-27 02:14:19 +0800
committerGitHub <noreply@github.com>2024-07-26 11:14:19 -0700
commit0581ce60961acc9969b69c5560d3d0fc91598739 (patch)
tree692b5f3aec4c6c19fe05fbb89a93ced0bf5e69be
parentec9455dab773e574174c54a4b54d2b1ebae1f249 (diff)
downloadseaweedfs-0581ce60961acc9969b69c5560d3d0fc91598739.tar.xz
seaweedfs-0581ce60961acc9969b69c5560d3d0fc91598739.zip
fix delete chunk failed if volumeSever specified grpc.port (#5820)
Co-authored-by: Yang Wang <yangwang@weride.ai>
-rw-r--r--weed/filer/filer_deletion.go6
-rw-r--r--weed/server/master_grpc_server_volume.go4
-rw-r--r--weed/server/master_server_handlers.go13
3 files changed, 17 insertions, 6 deletions
diff --git a/weed/filer/filer_deletion.go b/weed/filer/filer_deletion.go
index 5a40b6ee3..6e8322b3f 100644
--- a/weed/filer/filer_deletion.go
+++ b/weed/filer/filer_deletion.go
@@ -1,11 +1,12 @@
package filer
import (
- "github.com/seaweedfs/seaweedfs/weed/storage"
- "github.com/seaweedfs/seaweedfs/weed/util"
"strings"
"time"
+ "github.com/seaweedfs/seaweedfs/weed/storage"
+ "github.com/seaweedfs/seaweedfs/weed/util"
+
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/operation"
"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{
Url: loc.Url,
PublicUrl: loc.PublicUrl,
+ GrpcPort: loc.GrpcPort,
})
}
m[vid] = &operation.LookupResult{
diff --git a/weed/server/master_grpc_server_volume.go b/weed/server/master_grpc_server_volume.go
index f48326459..3cad627db 100644
--- a/weed/server/master_grpc_server_volume.go
+++ b/weed/server/master_grpc_server_volume.go
@@ -3,13 +3,14 @@ package weed_server
import (
"context"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/topology"
"math/rand"
"reflect"
"strings"
"sync"
"time"
+ "github.com/seaweedfs/seaweedfs/weed/topology"
+
"github.com/seaweedfs/raft"
"github.com/seaweedfs/seaweedfs/weed/glog"
@@ -115,6 +116,7 @@ func (ms *MasterServer) LookupVolume(ctx context.Context, req *master_pb.LookupV
Url: loc.Url,
PublicUrl: loc.PublicUrl,
DataCenter: loc.DataCenter,
+ GrpcPort: uint32(loc.GrpcPort),
})
}
var auth string
diff --git a/weed/server/master_server_handlers.go b/weed/server/master_server_handlers.go
index 00250452a..665f5c967 100644
--- a/weed/server/master_server_handlers.go
+++ b/weed/server/master_server_handlers.go
@@ -2,12 +2,13 @@ package weed_server
import (
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/glog"
"net/http"
"strconv"
"strings"
"time"
+ "github.com/seaweedfs/seaweedfs/weed/glog"
+
"github.com/seaweedfs/seaweedfs/weed/operation"
"github.com/seaweedfs/seaweedfs/weed/security"
"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)
for _, loc := range machines {
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)
for _, loc := range machines {
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