2019-07-24 18:26:43 +01:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
/*
|
|
|
|
Package gc contains the functions needed to run garbage collection.
|
|
|
|
|
2021-05-28 11:10:01 +01:00
|
|
|
The gc.PieceTracker implements the segments loop Observer interface
|
2019-07-24 18:26:43 +01:00
|
|
|
allowing us to subscribe to the loop to get information for every segment
|
2021-05-28 11:10:01 +01:00
|
|
|
in the metabase db.
|
2019-07-24 18:26:43 +01:00
|
|
|
|
|
|
|
The gc.PieceTracker handling functions are used by the gc.Service to periodically
|
|
|
|
account for all existing pieces on storage nodes and create "retain requests"
|
|
|
|
which contain a bloom filter of all pieces that possibly exist on a storage node.
|
|
|
|
|
2021-05-28 11:10:01 +01:00
|
|
|
The gc.Service will send that request to the storagenode after a full segments loop
|
2019-07-24 18:26:43 +01:00
|
|
|
iteration, and the storage node will use that request to delete the "garbage" pieces
|
|
|
|
that are not in the bloom filter.
|
|
|
|
|
|
|
|
See storj/docs/design/garbage-collection.md for more info.
|
|
|
|
*/
|
|
|
|
package gc
|