repark

abstract suspend fun repark(entry: ParkedAggregate, from: Int = entry.partition): Boolean

Replaces where the entry parking entry's aggregate stands (its partition, from version and position), why (its reason) and when (its failure time) with entry's, while the aggregate is parked in partition from; it never parks one that is not. It keeps the entry's retry state, gives it the next revision and clears its schedule. Its callers:

  • The worker that retried the aggregate, in the partition it read the entry in (from, the entry's own partition by default): a retry that handled the aggregate's streams up to a version and failed again there records where it now stands and why, so the next retry starts at that stream rather than handling the earlier ones again; unlike park it may move the from version later. It is called while no live entry of that aggregate is handled.

  • The owner of the partition the aggregate's key maps to now, after its source gained partitions: it re-homes the entry there (entry's partition), from the partition it parked in, so the due scan, an operator's request and a skip reach the owner that holds the aggregate's later entries back.

Fenced by the partition, not by the revision: a worker whose retry ends after the entry was re-homed writes nothing (the entry is no longer in from), while an operator's change during the retry, which does not move the entry, never voids the retry's own result.

Return

true when an entry was replaced; false when the aggregate is not parked in from (it was resolved, or re-homed, meanwhile).