fork of https://github.com/sourcegraph/zoekt
0

Configure Feed

Select the types of activity you want to include in your feed.

indexserver: remove feature flag for explode (#391)

I should have removed this feature flag a long time ago. Maxim and I stumbled across
this during a review. On Cloud we have the feature flag set for all
instances, so this change should have no impact.

+11 -26
+11 -26
cmd/zoekt-sourcegraph-indexserver/cleanup.go
··· 10 10 "strings" 11 11 "time" 12 12 13 - "github.com/google/zoekt" 14 13 "github.com/grafana/regexp" 15 14 "github.com/prometheus/client_golang/prometheus" 16 15 "github.com/prometheus/client_golang/prometheus/promauto" 17 16 "gopkg.in/natefinch/lumberjack.v2" 17 + 18 + "github.com/google/zoekt" 18 19 ) 19 20 20 21 var metricCleanupDuration = promauto.NewHistogram(prometheus.HistogramOpts{ ··· 433 434 } 434 435 435 436 if info.Size() < s.minSizeBytes { 436 - // feature flag: place file EXPLODE in IndexDir 437 - if _, err := os.Stat(filepath.Join(s.IndexDir, "EXPLODE")); err == nil { 438 - cmd := exec.Command("zoekt-merge-index", "explode", path) 437 + cmd := exec.Command("zoekt-merge-index", "explode", path) 439 438 440 - var b []byte 441 - s.muIndexDir.Global(func() { 442 - b, err = cmd.CombinedOutput() 443 - }) 439 + var b []byte 440 + s.muIndexDir.Global(func() { 441 + b, err = cmd.CombinedOutput() 442 + }) 444 443 445 - if err != nil { 446 - debug.Printf("failed to explode compound shard %s: %s", path, string(b)) 447 - } else { 448 - shardsLog(s.IndexDir, "explode", []shard{{Path: path}}) 449 - } 450 - continue 444 + if err != nil { 445 + debug.Printf("failed to explode compound shard %s: %s", path, string(b)) 451 446 } else { 452 - paths, err := zoekt.IndexFilePaths(path) 453 - if err != nil { 454 - debug.Printf("failed getting all file paths for %s", path) 455 - continue 456 - } 457 - s.muIndexDir.Global(func() { 458 - for _, p := range paths { 459 - os.Remove(p) 460 - } 461 - }) 462 - shardsLog(s.IndexDir, "delete", []shard{{Path: path}}) 463 - continue 447 + shardsLog(s.IndexDir, "explode", []shard{{Path: path}}) 464 448 } 449 + continue 465 450 } 466 451 467 452 var removed []*zoekt.Repository