mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-11-09 00:34:45 +08:00
ec.encode: Explictly mount EC shards after volume conversion. (#6528)
Some checks failed
go: build dev binaries / cleanup (push) Has been cancelled
docker: build dev containers / build-dev-containers (push) Has been cancelled
End to End / FUSE Mount (push) Has been cancelled
go: build binary / Build (push) Has been cancelled
Ceph S3 tests / Ceph S3 tests (push) Has been cancelled
go: build dev binaries / build_dev_linux_windows (amd64, linux) (push) Has been cancelled
go: build dev binaries / build_dev_linux_windows (amd64, windows) (push) Has been cancelled
go: build dev binaries / build_dev_darwin (amd64, darwin) (push) Has been cancelled
go: build dev binaries / build_dev_darwin (arm64, darwin) (push) Has been cancelled
Some checks failed
go: build dev binaries / cleanup (push) Has been cancelled
docker: build dev containers / build-dev-containers (push) Has been cancelled
End to End / FUSE Mount (push) Has been cancelled
go: build binary / Build (push) Has been cancelled
Ceph S3 tests / Ceph S3 tests (push) Has been cancelled
go: build dev binaries / build_dev_linux_windows (amd64, linux) (push) Has been cancelled
go: build dev binaries / build_dev_linux_windows (amd64, windows) (push) Has been cancelled
go: build dev binaries / build_dev_darwin (amd64, darwin) (push) Has been cancelled
go: build dev binaries / build_dev_darwin (arm64, darwin) (push) Has been cancelled
This guarantees EC shards are immediately available after encoding, even if not affected by subsequent re-balancing.
This commit is contained in:
@@ -143,6 +143,7 @@ func doEcEncode(commandEnv *CommandEnv, collection string, vid needle.VolumeId,
|
|||||||
if !found {
|
if !found {
|
||||||
return fmt.Errorf("volume %d not found", vid)
|
return fmt.Errorf("volume %d not found", vid)
|
||||||
}
|
}
|
||||||
|
target := locations[0]
|
||||||
|
|
||||||
// mark the volume as readonly
|
// mark the volume as readonly
|
||||||
ewg = NewErrorWaitGroup(maxParallelization)
|
ewg = NewErrorWaitGroup(maxParallelization)
|
||||||
@@ -159,8 +160,8 @@ func doEcEncode(commandEnv *CommandEnv, collection string, vid needle.VolumeId,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// generate ec shards
|
// generate ec shards
|
||||||
if err := generateEcShards(commandEnv.option.GrpcDialOption, vid, collection, locations[0].ServerAddress()); err != nil {
|
if err := generateEcShards(commandEnv.option.GrpcDialOption, vid, collection, target.ServerAddress()); err != nil {
|
||||||
return fmt.Errorf("generate ec shards for volume %d on %s: %v", vid, locations[0].Url, err)
|
return fmt.Errorf("generate ec shards for volume %d on %s: %v", vid, target.Url, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ask the source volume server to delete the original volume
|
// ask the source volume server to delete the original volume
|
||||||
@@ -178,6 +179,15 @@ func doEcEncode(commandEnv *CommandEnv, collection string, vid needle.VolumeId,
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// mount all ec shards for the converted volume
|
||||||
|
shardIds := make([]uint32, erasure_coding.TotalShardsCount)
|
||||||
|
for i := range shardIds {
|
||||||
|
shardIds[i] = uint32(i)
|
||||||
|
}
|
||||||
|
if err := mountEcShards(commandEnv.option.GrpcDialOption, collection, vid, target.ServerAddress(), shardIds); err != nil {
|
||||||
|
return fmt.Errorf("mount ec shards for volume %d on %s: %v", vid, target.Url, err)
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user