shell: volume.tier.move makes up changes if volume move failed

This commit is contained in:
Chris Lu
2021-08-13 03:09:28 -07:00
parent 333cdce485
commit 0f7d4556d8
4 changed files with 21 additions and 25 deletions

View File

@@ -4,6 +4,7 @@ import (
"context"
"flag"
"fmt"
"github.com/chrislusf/seaweedfs/weed/wdclient"
"io"
"log"
"time"
@@ -190,3 +191,13 @@ func markVolumeWritable(grpcDialOption grpc.DialOption, volumeId needle.VolumeId
return err
})
}
func markVolumeReplicasWritable(grpcDialOption grpc.DialOption, volumeId needle.VolumeId, locations []wdclient.Location, writable bool) error {
for _, location := range locations {
fmt.Printf("markVolumeReadonly %d on %s ...\n", volumeId, location.Url)
if err:= markVolumeWritable(grpcDialOption, volumeId, location.Url, writable); err != nil {
return err
}
}
return nil
}