Repository navigation
Release v19.178.0
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.dormantAfterseconds (default900). 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 thanobservers.dormantResumeMaxEvents(default1000) uses a catch-up job instead. Setobservers.dormantAfterto0to keep every subscribed observer in memory. - A safety net: every dormant observer is also woken at least every
observers.dormantSafetyNetseconds (default900, jittered per observer) so a lost wake-up delays delivery by at most that long.observers.maxConcurrentWakes(default0, automatic) bounds how many observers one silo wakes at once. observers.durableSubscriptionsnow has the valueRelease(the default), next toShadowandOff. The observer records its subscription in its own state and is released and woken from that record. SQL stores get a nullableDurableSubscriptioncolumn on the observer table; MongoDB gets an optional field. Older kernels ignore both.connectedClients.keeperMode(SiloLocal, the default, orLegacy). 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.Legacyrestores the call on every check.- Metrics:
cratis.chronicle.observer.dormant(gauge per event store and namespace),observer.dormant_releases,observer.dormant_wakes(attributecratis.chronicle.observer.wake_cause:eventorsafety_net),observer.dormant_wakes_delayedandobserver.dormant_resumes(attributecratis.chronicle.observer.resume_outcome:cursor,catch_uporstale_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.UnseenRemovalEnabledtotrue. When on, a client reactor or reducer that no client has held a subscription to, in any namespace, forObservers.UnseenRemovalAfter(default7.00:00:00) is removed with its definition, state, failed partitions, jobs and reminders;Observers.UnseenRemovalSweepInterval(default01:00:00) andObservers.UnseenRemovalBatchSize(default100) 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 atInformationlevel and counted bychronicle.observers.unseen_removed. When the kernel last saw each client observer is recorded whether or not the removal is on. SQL storage gets a nullableLastSeenAtcolumn (migrationv19_173_0); MongoDB gets an optionallastSeenAtfield. - 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.residentto fall andobserver.dormantto rise, and the first event for a released observer to pay one activation. A new observer becomes dormant a few minutes after it subscribes. Setobservers.dormantAfterto0to turn it off, orobservers.durableSubscriptionstoShadoworOff. - Default behavior change: with
connectedClients.keeperModeSiloLocal, 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 toLegacyto 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
unseenRemovalAfterhas 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.