This commit is contained in:
Chris Lu 2019-06-10 21:33:32 -07:00
parent f9d8bd51ad
commit 57092d69ac
7 changed files with 8 additions and 11 deletions

View file

@ -85,4 +85,3 @@ func NewFilerServer(defaultMux, readonlyMux *http.ServeMux, option *FilerOption)
return fs, nil
}

View file

@ -234,4 +234,3 @@ func (fs *FilerServer) writeContent(w io.Writer, entry *filer2.Entry, offset int
return filer2.StreamContent(fs.filer.MasterClient, w, entry.Chunks, offset, size)
}

View file

@ -59,7 +59,7 @@ func (vs *VolumeServer) maybeCheckJwtAuthorization(r *http.Request, vid, fid str
} else {
signingKey = vs.guard.SigningKey
}
}else {
} else {
if len(vs.guard.ReadSigningKey) == 0 {
return true
} else {

View file

@ -466,7 +466,7 @@ func pickOneEcNodeAndMoveOneShard(ctx context.Context, commandEnv *CommandEnv, e
return nil
}
func pickNEcShardsToMoveFrom(ecNodes []*EcNode, vid needle.VolumeId, n int) (map[erasure_coding.ShardId]*EcNode) {
func pickNEcShardsToMoveFrom(ecNodes []*EcNode, vid needle.VolumeId, n int) map[erasure_coding.ShardId]*EcNode {
picked := make(map[erasure_coding.ShardId]*EcNode)
var candidateEcNodes []*CandidateEcNode
for _, ecNode := range ecNodes {

View file

@ -40,7 +40,6 @@ var (
Commands = []command{}
)
func NewCommandEnv(options ShellOptions) *CommandEnv {
return &CommandEnv{
env: make(map[string]string),

View file

@ -222,11 +222,11 @@ func (s *Store) cachedLookupEcShardLocations(ctx context.Context, ecVolume *eras
shardCount := len(ecVolume.ShardLocations)
if shardCount < erasure_coding.DataShardsCount &&
ecVolume.ShardLocationsRefreshTime.Add(11 * time.Second).After(time.Now()) ||
ecVolume.ShardLocationsRefreshTime.Add(11*time.Second).After(time.Now()) ||
shardCount == erasure_coding.TotalShardsCount &&
ecVolume.ShardLocationsRefreshTime.Add(37 * time.Minute).After(time.Now()) ||
ecVolume.ShardLocationsRefreshTime.Add(37*time.Minute).After(time.Now()) ||
shardCount >= erasure_coding.DataShardsCount &&
ecVolume.ShardLocationsRefreshTime.Add(7 * time.Minute).After(time.Now()) {
ecVolume.ShardLocationsRefreshTime.Add(7*time.Minute).After(time.Now()) {
// still fresh
return nil
}