Skip to content

Commit

Permalink
fix(share/eds): turn off eds store dagstore gc by default (#2529)
Browse files Browse the repository at this point in the history
Dagstore GC performs garbage collection by reclaiming transient files of
shards that are currently available but inactive, or errored. We don't
use transient files right now, so GC is turned off by default.
  • Loading branch information
walldiss authored Aug 1, 2023
1 parent 208bb86 commit 13c2dab
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions share/eds/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ const (
indexPath = "/index/"
transientsPath = "/transients/"

defaultGCInterval = time.Hour
// GC performs DAG store garbage collection by reclaiming transient files of
// shards that are currently available but inactive, or errored.
// We don't use transient files right now, so GC is turned off by default.
defaultGCInterval = 0
)

var ErrNotFound = errors.New("eds not found in store")
Expand Down Expand Up @@ -117,13 +120,16 @@ func (s *Store) Start(ctx context.Context) error {
return err
}
// start Store only if DagStore succeeds
ctx, cancel := context.WithCancel(context.Background())
runCtx, cancel := context.WithCancel(context.Background())
s.cancel = cancel
// initialize empty gc result to avoid panic on access
s.lastGCResult.Store(&dagstore.GCResult{
Shards: make(map[shard.Key]error),
})
go s.gc(ctx)

if s.gcInterval != 0 {
go s.gc(runCtx)
}
return nil
}

Expand Down

0 comments on commit 13c2dab

Please sign in to comment.