Skip to content

Release v19.178.0

Choose a tag to compare

@github-actions github-actions released this 20 Nov 21:43
338c5cd

Chronicle now releases subscribed client reactors, client reducers and projections that have nothing to do after 15 minutes, and wakes them when an event they observe is appended, so the memory and idle work of a kernel follow the observers that have work instead of every observer of every tenant. It can also remove client reactors and reducers that no client has subscribed to for a configurable period, an opt-in feature that is off by default.

Added

  • Dormant observers. A subscribed client reactor, client reducer or projection with nothing owed is released after observers.dormantAfter seconds (default 900). The appended events queue wakes it when an event it observes is appended and it resumes from its stored position, handling each event once and in order, then goes dormant again. A wake that finds a larger gap than observers.dormantResumeMaxEvents (default 1000) uses a catch-up job instead. Set observers.dormantAfter to 0 to keep every subscribed observer in memory.
  • A safety net: every dormant observer is also woken at least every observers.dormantSafetyNet seconds (default 900, jittered per observer) so a lost wake-up delays delivery by at most that long. observers.maxConcurrentWakes (default 0, automatic) bounds how many observers one silo wakes at once.
  • observers.durableSubscriptions now has the value Release (the default), next to Shadow and Off. The observer records its subscription in its own state and is released and woken from that record. SQL stores get a nullable DurableSubscription column on the observer table; MongoDB gets an optional field. Older kernels ignore both.
  • connectedClients.keeperMode (SiloLocal, the default, or Legacy). A client's open stream confirms a subscription from the recorded subscription instead of calling the client's grains, so it no longer wakes a dormant observer or keeps the client's reactor and reducer grains in memory for it. Legacy restores the call on every check.
  • Metrics: cratis.chronicle.observer.dormant (gauge per event store and namespace), observer.dormant_releases, observer.dormant_wakes (attribute cratis.chronicle.observer.wake_cause: event or safety_net), observer.dormant_wakes_delayed and observer.dormant_resumes (attribute cratis.chronicle.observer.resume_outcome: cursor, catch_up or stale_record). Legacy names exist for the four counters.
  • Opt-in removal of unseen client observers. It is off by default: nothing is removed unless you set Observers.UnseenRemovalEnabled to true. When on, a client reactor or reducer that no client has held a subscription to, in any namespace, for Observers.UnseenRemovalAfter (default 7.00:00:00) is removed with its definition, state, failed partitions, jobs and reminders; Observers.UnseenRemovalSweepInterval (default 01:00:00) and Observers.UnseenRemovalBatchSize (default 100) tune the sweep. A removed observer replays from the start if its client returns. A reducer's read model data is never deleted. Each removal is logged at Information level and counted by chronicle.observers.unseen_removed. When the kernel last saw each client observer is recorded whether or not the removal is on. SQL storage gets a nullable LastSeenAt column (migration v19_173_0); MongoDB gets an optional lastSeenAt field.
  • Documentation: an operator section on releasing dormant observers with what it is, the defaults, the 15-minute safety-net bound, how to turn it off and which metrics to watch, the configuration reference rows, the telemetry names and an upgrade note. Decisions 0034 (dormant subscribed observers), 0035 and 0036 (removal of unseen client observers, opt in).

Changed

  • Default behavior change: subscribed client reactors, client reducers and projections that have nothing to do are released after 15 minutes. Expect cratis.chronicle.observer.resident to fall and observer.dormant to rise, and the first event for a released observer to pay one activation. A new observer becomes dormant a few minutes after it subscribes. Set observers.dormantAfter to 0 to turn it off, or observers.durableSubscriptions to Shadow or Off.
  • Default behavior change: with connectedClients.keeperMode SiloLocal, a client's stream confirms subscriptions from the recorded subscription. An observer without a recorded subscription is still checked with the grain calls. Set it to Legacy to restore the previous behavior.
  • Listing observers, reading one observer and reading its connected clients leave a dormant observer dormant and report it as subscribed. The projections manager no longer wakes dormant projections when the kernel starts or a silo leaves.
  • A client that disconnects while its observers are dormant is still unsubscribed, and when a silo leaves the cluster the observers that recorded a client served from it validate their record and drop what is gone.
  • Nothing is released until every silo of the cluster runs this release; a rolling upgrade keeps the observers hosted by older silos resident. Upgrading removes no observer: the removal of unseen observers is off unless you turn it on, and an observer without a recorded last-seen time is not removed until a full unseenRemovalAfter has passed after the first sweep that finds it.
  • When the removal of unseen observers is on, projections, webhooks, event store subscriptions and kernel observers are never removed, and neither is an observer that is subscribed, replaying, catching up, quarantined, or that has failed partitions or unfinished jobs. Replaying, catching-up and quarantined observers and observers with failed partitions or jobs are never released.