ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Registry.Sweep.Types

Description

The mirror sweep's inputs, effects, and cycle state. Store operations arrive through Ecluse.Core.Registry.Maintenance handles.

Synopsis

What a sweep runs over

data SweepMount Source #

One mount's sweepable store, and everything that decides for it.

Constructors

SweepMount 

Fields

  • smEcosystem :: Ecosystem

    The mount's ecosystem, which names it in an audit line.

  • smStore :: SweepStore

    The store's own calls. Every backend-varying fact is a value on it.

  • smRules :: [PreparedRule]

    The mount's own prepared rule set, the one the serve and ingest gates evaluate.

  • smConfigured :: [Rule]

    The same rules as configured values, which a prepared rule no longer carries. The candidate set reads an identity deny's names out of these.

  • smRuleDeps :: RuleDeps

    Lookup acquisition, which candidate discovery and a later verdict may take at different generations.

  • smProjectName :: ProjectName

    The ecosystem's own name parser, which both halves of the candidate set are read through.

  • smFirstParty :: PackageName -> Bool

    Whether a name belongs to a namespace this deployment owns, derived once at the composition root.

data SweepStore Source #

One mount's sweepable store, with the private cache it is always swept beside.

Constructors

SweepStore 

Fields

data SweepCache Source #

One store's own two halves. A cache is paired with no further store, so it carries none.

data SweepExecution Source #

What a run does with a condemned version. Only one arm carries a write.

Constructors

SweepRemoves StoreDeletion

Hand the versions to the store's own delete, and record each completed bucket.

SweepCounts

Count the versions and reach nothing that could change the store.

deletingCache :: StoreMaintenance -> SweepCache Source #

The whole handle as a deleting run holds it: its reads, and its writes as the execution.

previewCache :: StoreObservation -> SweepCache Source #

The observing calls alone, as a preview holds them.

pairedStore :: Int -> SweepCache -> SweepCache -> SweepStore Source #

A mount's store: the mirror target's halves, its private cache, and the bound they share.

privateStore :: SweepStore -> SweepStore Source #

The mount's other store: its private cache, under the same pairing and bound.

countingAt :: SweepStore -> StoreObservation -> SweepStore Source #

The mount's store seen at one observation, counting only. A located view names its own backend in an audit line and reaches nothing that could change a store.

walkMarkerOf :: SweepStore -> Maybe StoreCursor Source #

The marker a full walk resumes from. A preview holds none, so its walk starts at the first bucket and the recorded marker is neither read nor replaced.

data SweepPacing Source #

How a sweep paces itself, how much one cycle may delete, and which shape it runs.

Constructors

SweepPacing 

Fields

  • swpChunkSize :: Int

    Candidate packages one chunk examines before the sweep pauses.

  • swpChunkPause :: NominalDiffTime

    The wait between chunks, and the wait a fault whose advice names no delay takes.

  • swpCyclePause :: NominalDiffTime

    The wait between the end of one cycle and the start of the next, a halted one included. The role's own loop applies it, so a cycle is one supervised step.

  • swpCycleWindow :: NominalDiffTime

    The window an advisory is paced to reach every affected mirrored version inside. It covers the rest of the running cycle, the cycle pause, and the next whole cycle.

  • swpBudgetFraction :: Maybe Rational

    The share of a store's request capacity one sweep may take, else computed per scope.

  • swpDeletionCap :: Int

    Versions one cycle may hand over for deletion before it halts for good.

  • swpShape :: SweepShape

    Which names the cycle carries to the rules.

Instances

Instances details
Show SweepPacing Source # 
Instance details

Defined in Ecluse.Core.Registry.Sweep.Types

Eq SweepPacing Source # 
Instance details

Defined in Ecluse.Core.Registry.Sweep.Types

minimumChunkPause :: NominalDiffTime Source #

The shortest pause a sweep may be paced by, which the boot refuses beneath. Deletion is permanent, and the pause between chunks is what leaves time to stop a mistaken run.

deletionCapPerStore :: Int Source #

Versions one cycle may hand over per sweepable store, which the cap's default is computed from. A cycle covers every store in turn, so one pinned total would starve the later mounts.

data SweepShape Source #

Which names one cycle decides. A full walk is a superset of a candidate cycle, so the two never run beside each other.

Constructors

SweepCandidates

Every store name the advisory database covers or an identity deny pins. It is bounded by the listing for store size and by advisory hits for reads.

SweepEverything

Every name in the store, bucket by bucket, resuming from the store's own cursor. It covers a rule-configuration change, which no candidate set can see.

Instances

Instances details
Show SweepShape Source # 
Instance details

Defined in Ecluse.Core.Registry.Sweep.Types

Eq SweepShape Source # 
Instance details

Defined in Ecluse.Core.Registry.Sweep.Types

data SweepReport Source #

How one run reports a removal, and whether its cap stops the cycle. A preview holds no delete at all, so the loop reads these rather than asking which mode it is in.

Constructors

SweepReport 

Fields

data SweepPorts Source #

The effects the sweep reaches the running system through.

Constructors

SweepPorts 

Fields

data SweepAudit Source #

Where the sweep reports. The two severities are separate fields rather than a level argument, so a caller cannot log a halt as routine.

Constructors

SweepAudit 

Fields

  • auditInfo :: Text -> IO ()

    One routine line: a deletion, a preview's own count, a completed cycle.

  • auditWarn :: Text -> IO ()

    One line that may clear on its own: a store call being retried.

  • auditError :: Text -> IO ()

    One line an operator must act on: a halt, a refused deletion, a store fault.

sweepTargetOf :: SweepMount -> StoreObservation -> SweepTarget Source #

Which of a mount's two locations a store is. The decision keys on the backend name, so a mount whose mirror store and private cache report one name reads as the mirror at both.

locatedPorts :: SweepMount -> StoreObservation -> SweepPorts -> SweepPorts Source #

The ports an audit line from one located store is written through, labelled and targeted.

The cycle's running state

data SweepState Source #

Cycle totals and pacing. The issued count bounds attempts, while the tally records outcomes.

Constructors

SweepState 

Fields

newSweepState :: IO SweepState Source #

Start a cycle with no counts or pending chunk pause.

record :: SweepPorts -> SweepState -> SweepResult -> IO () Source #

Count one version's disposition, in the cycle tally and at the metrics port together.

recordMetric :: SweepPorts -> SweepResult -> IO () Source #

Count a target operation separately from a deduplicated logical preview tally.

recordTally :: SweepState -> SweepResult -> IO () Source #

Update the cycle tally without recording a second target operation.

recordGap :: SweepState -> EvidenceGaps -> IO () Source #

Record one gap in what this cycle could read.

recordPrerequisites :: SweepState -> TargetPrerequisites -> IO () Source #

Record one target's standing permissions, which only a preview reads rather than acts on.