object Sweeper
Infrequently running cleanup of "leaked" data or data which is otherwise unaccounted for. Unlike the cleanup process (which is optimized for precision and efficiency), the Sweeper is optimized for comprehensiveness over time via repeated execution (even if we miss some "garbage" on execution i, we will eventually clean it up on excution i + N). We only need to ensure that we 1.) cleanup data that was missed during the Cleanup operation and 2.) ensure we aren't progressively leaking resources over the long-term.
Items that are identified as an "UnclaimedResource" (items that have no obvious owner -- which may or may not be garbage) are NOT deleted but will be tracked and counted by the end of the task. The number of Unclaimed Resources will be recorded as a histogram, to allow us to have visibility of accumulation on such items. In the event that we discover that the amount of Unclaimed Resources is increasing over time this is a possible indication that we have a major leakage signaling the need to modify the sweeper to be more aggressive.
- Source
- Sweeper.scala
- Alphabetic
- By Inheritance
- Sweeper
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- type SweeperHelmOp = (Datacenter, Either[UnclaimedResources, ConsulOpF[Unit]])
- type SweeperHelmOps = List[SweeperHelmOp]
- final case class UnclaimedResources(n: Int) extends Product with Serializable
Value Members
- def cleanupLeakedConsulDiscoveryKeys(cfg: NelsonConfig): IO[SweeperHelmOps]
- val log: Logger
- def process(cfg: NelsonConfig)(implicit unclaimedResourceTracker: Kleisli[IO, (Datacenter, Int), Unit]): Stream[IO, Unit]
- def sweeperSink(implicit unclaimedResourceTracker: Kleisli[IO, (Datacenter, Int), Unit]): Sink[IO, SweeperHelmOp]
- val timer: ~>[IO, IO]
- object SingleUnclaimedResource extends Product with Serializable