master: followers can also lookup and redirect

improve scalability
This commit is contained in:
Chris Lu
2019-07-28 03:58:13 -07:00
parent 2c6cf72e73
commit 8afd8d35b3
9 changed files with 76 additions and 50 deletions

View File

@@ -87,8 +87,8 @@ func (c *commandEcEncode) Do(args []string, commandEnv *CommandEnv, writer io.Wr
func doEcEncode(ctx context.Context, commandEnv *CommandEnv, collection string, vid needle.VolumeId) (err error) {
// find volume location
locations := commandEnv.MasterClient.GetLocations(uint32(vid))
if len(locations) == 0 {
locations, found := commandEnv.MasterClient.GetLocations(uint32(vid))
if !found {
return fmt.Errorf("volume %d not found", vid)
}