Skip to content

JasperFx 2.102.0

Choose a tag to compare

@jeremydmiller jeremydmiller released this 09 Nov 15:55
· 171 commits to main since this release

JasperFx 2.102.0 is a minor release with one new IEventDatabase capability. It lets monitoring report projection lag as time rather than as a count of events.

  • IEventDatabase.FetchFirstEventTimestampsAfterAsync, the age of the oldest unprocessed event (#1150 / #1151).
    • Why: a backlog counted in events says little on a multi-tenant fleet. 40,000 events spread over 130 tenants is fine; 40,000 on one tenant for an hour is not. The age of the oldest event a shard hasn't processed tells those two apart, and it's the number an SLO is written against. CritterWatch reaches event stores only through the JasperFx.Events abstractions, so the question has to be answerable here.
    • What it answers: for each (TenantId, Sequence) position, it returns the store's timestamp of the first event with a higher sequence, or null when there is none (the shard is caught up). You get one PendingEventAge(TenantId, Sequence, Timestamp) per position, in the order asked. PendingEventAge also has IsCaughtUp and AgeAt(now), which never returns a negative age when clocks are skewed.
    • Tenants: a null tenant considers every event in the database. A non-null tenant considers only that tenant's events under conjoined tenancy or per-tenant partitioning.
    • Archived events don't count. The async daemon skips them, so a shard is never waiting on one.
    • Cost: stores answer the whole list in one round trip per database, with one sequence seek per position, never a scan or a count. Ask only about shards that are behind.
    • Default implementations: the batched member throws NotSupportedException on a store that hasn't implemented it. A null timestamp means "caught up", so that default can't answer without reporting a lagging shard as current. The single-position convenience FetchFirstEventTimestampAfterAsync(sequence, tenantId) calls the batched member by default. The in-memory prototyping store implements both.
  • Compliance: a new PendingEventAgeCompliance suite, gated by SupportsPendingEventAges (default false), with 12 facts. They cover the "strictly after" rule, ordering and duplicates, archived events and conjoined tenant scoping. A new SupportsStreamArchiving fixture flag (default true) gates the archived facts. Stores must enroll the new suite (or excuse it) or ComplianceSuiteInventory.AssertEnrolled fails.

Marten, Polecat and Fisher implement the method in their JasperFx 2.102.0 upgrades.

What's Changed

Full Changelog: v2.101.1...v2.102.0