gc: remove segment loop dependency

While splitting GC into two parts, bloom filter generation and bloom
filter sending, we missed to remove segments loop dependency from boom
filter sending part.

Change-Id: I48f213b0c0f8583e24fbb2bdcbfced518abe74cb
This commit is contained in:
Michal Niewrzal 2023-02-03 11:09:26 +01:00
parent 0b519fbd05
commit 828654f98b

View File

@ -25,7 +25,6 @@ import (
version_checker "storj.io/storj/private/version/checker" version_checker "storj.io/storj/private/version/checker"
"storj.io/storj/satellite/gc/sender" "storj.io/storj/satellite/gc/sender"
"storj.io/storj/satellite/metabase" "storj.io/storj/satellite/metabase"
"storj.io/storj/satellite/metabase/segmentloop"
"storj.io/storj/satellite/overlay" "storj.io/storj/satellite/overlay"
) )
@ -56,10 +55,6 @@ type GarbageCollection struct {
DB overlay.DB DB overlay.DB
} }
Metainfo struct {
SegmentLoop *segmentloop.Service
}
GarbageCollection struct { GarbageCollection struct {
Sender *sender.Service Sender *sender.Service
} }
@ -128,23 +123,6 @@ func NewGarbageCollection(log *zap.Logger, full *identity.FullIdentity, db DB,
peer.Overlay.DB = peer.DB.OverlayCache() peer.Overlay.DB = peer.DB.OverlayCache()
} }
{ // setup metainfo
// Garbage Collection creates its own instance of the loop here. Since
// GC runs infrequently, this shouldn't add too much extra load on the metabase db.
// As long as garbage collection is the only observer joining the loop, then by default
// the loop will only run when the garbage collection joins (which happens every GarbageCollection.Interval)
peer.Metainfo.SegmentLoop = segmentloop.New(
log.Named("segmentloop"),
config.Metainfo.SegmentLoop,
metabaseDB,
)
peer.Services.Add(lifecycle.Item{
Name: "metainfo:segmentloop",
Run: peer.Metainfo.SegmentLoop.Run,
Close: peer.Metainfo.SegmentLoop.Close,
})
}
{ // setup garbage collection { // setup garbage collection
peer.GarbageCollection.Sender = sender.NewService( peer.GarbageCollection.Sender = sender.NewService(
peer.Log.Named("gc-sender"), peer.Log.Named("gc-sender"),