Skip to content

Release v19.153.0

Choose a tag to compare

@github-actions github-actions released this 10 Nov 11:02
9157c14

Reducers now receive events in pages that span many event sources, page sizes follow what a client declares, the .NET client checks batch methods at compile time and in tests, and event sequences gain a resumable bulk import for hundreds of thousands of events.

Added

  • Client reducers that take pages receive events in pages spanning many event sources on live delivery, catch-up and replay. The kernel reads the current read models of a page together, writes the event sources that succeeded together, and writes nothing for an event source the reducer failed or deferred. See Batches for reducers.
  • [BatchSize] on a reactor or reducer declares the most events and bytes in one page and, for reducers, how many event sources of a page are reduced at once (MaxConcurrency, the processor count by default). MaxDelayMilliseconds is accepted but not applied yet.
  • The kernel honors the page bounds a client declares on every path, capped by the new Observers.MaxEventsPerPage (1 000 by default) and Observers.MaxBytesPerSubscriberCall (4 MiB by default) settings. A delivery above the bounds is sent as several pages in order, and a single event larger than the byte bound is sent on its own. See Observers configuration.
  • Analyzers CHR0070 to CHR0077 report batch method mistakes at compile time: [Observes<T>] on a method that does not take an EventBatch, a batch method that observes nothing, an event type that reaches more than one method, a BatchContext on a per-event method, a reactor batch method that returns something, a reducer that mixes batch and per-event methods, a batch signature Chronicle cannot call, and a warning for a pattern on an event type the method does not observe. See Code analysis.
  • Registering a reactor or reducer refuses a batch method whose parameters Chronicle cannot supply, and a per-event reducer method that takes a BatchContext. A batch method may declare CancellationToken cancellationToken = default.
  • ReactorScenario runs batch methods: the events of one Events(...) call, or of Given.Page(...) across event sources, reach them as one page, and ShouldHaveFailed and ShouldHaveDeferred assert what a batch method settled. ReadModelScenario runs batch reducers and surfaces a deferral as ReducerDeferred.
  • Event sequences can import large volumes of events through a resumable import session: eventLog.Import(events) takes an IAsyncEnumerable or IEnumerable and streams it in chunks, and BeginImport gives an explicit session that can be reattached by ImportId. Every event is validated before anything is committed, the commit runs as a job that survives restarts without appending twice, ordinary appends keep flowing during the commit, and observers catch up on the imported events chunk by chunk. See Importing events.
  • EventForEventSourceId gains CorrelationId, CausedBy, Generation and SourceSequenceNumber, which imports carry through to the stored events.
  • Kernel configuration section Imports sets staging retention (24 hours by default), the commit chunk size and the chunk limits clients receive.

Changed

  • Reactors and reducers that take pages now get pages of at most Observers.MaxEventsPerPage events and Observers.MaxBytesPerSubscriberCall bytes, where a page previously had no byte limit. Raise the settings if a client needs larger pages.
  • A failed write of one event source in a reducer page now fails only that event source, and a concurrent single-event-source reduce is reported as handled only once its state is stored.

Fixed

  • Client reactors and reducers with pages now receive live pages spanning several event sources. Because a client always subscribes with filters, and a burst larger than the live delivery budget was not split, live delivery previously sent one event source at a time.