Browse Source

merge some previous missing changes

pull/4857/head
chrislu 1 year ago
parent
commit
d531b7cbbf
  1. 7
      weed/server/filer_grpc_server_dlm.go

7
weed/server/filer_grpc_server_dlm.go

@ -19,7 +19,7 @@ func (fs *FilerServer) DistributedLock(ctx context.Context, req *filer_pb.LockRe
var movedTo pb.ServerAddress
expiredAtNs := time.Now().Add(time.Duration(req.SecondsToLock) * time.Second).UnixNano()
resp.RenewToken, movedTo, err = fs.filer.Dlm.LockWithTimeout(req.Name, expiredAtNs, req.RenewToken, req.Owner)
glog.Infof("lock %s %v %v %v, isMoved=%v %v", req.Name, req.SecondsToLock, req.RenewToken, req.Owner, req.IsMoved, movedTo)
glog.V(3).Infof("lock %s %v %v %v, isMoved=%v %v", req.Name, req.SecondsToLock, req.RenewToken, req.Owner, req.IsMoved, movedTo)
if movedTo != "" && movedTo != fs.option.Host && !req.IsMoved {
err = pb.WithFilerClient(false, 0, movedTo, fs.grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
secondResp, err := client.DistributedLock(context.Background(), &filer_pb.LockRequest{
@ -90,8 +90,11 @@ func (fs *FilerServer) FindLockOwner(ctx context.Context, req *filer_pb.FindLock
Name: req.Name,
IsMoved: true,
})
owner = secondResp.Owner
if err != nil {
return err
}
owner = secondResp.Owner
return nil
})
if err != nil {
return nil, err

Loading…
Cancel
Save