From a0243e144c89438ed45aec85429b2c70190d5f18 Mon Sep 17 00:00:00 2001 From: "Jeremy D. Miller" Date: Tue, 13 Oct 2026 18:55:51 -0500 Subject: [PATCH] JasperFx 2.87.1: override IEventStore.TryDescribeDatabasesAsync, and Marten 9.50.1 JasperFx/wolverine#5002 (from #5652). JasperFx 2.87.1 adds IEventStore.TryDescribeDatabasesAsync, the database half of TryCreateUsage, which Wolverine's agent assignment now asks for on every leader heartbeat instead of the full usage. Marten answers it from Options.Tenancy.DescribeDatabasesAsync, the same call TryCreateUsage makes for its database half. - JasperFx family 2.87.0 -> 2.87.1. - Marten 9.50.1. Co-Authored-By: Claude Opus 5.5 --- Directory.Build.props | 2 +- Directory.Packages.props | 10 +++++----- src/CoreTests/document_store_usage_tests.cs | 22 +++++++++++++++++++++ src/Marten/DocumentStore.EventStore.cs | 10 ++++++++++ 4 files changed, 38 insertions(+), 6 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 951346699f..92f06b9868 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - 9.50.0 + 9.50.1 13.0 Jeremy D. Miller;Babu Annamalai;Jaedyn Tonee https://martendb.io/logo.png diff --git a/Directory.Packages.props b/Directory.Packages.props index b3b2ec432b..4710672724 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -810,15 +810,15 @@ model command's spec generation, and jasperfx#1010 stops the daemon starting a shard while its projection is being rebuilt. Neither reaches a Marten runtime path; the bump keeps the five packages moving together, which they have since marten#5305. --> - - + + - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/CoreTests/document_store_usage_tests.cs b/src/CoreTests/document_store_usage_tests.cs index 96616adbad..9bf22f5785 100644 --- a/src/CoreTests/document_store_usage_tests.cs +++ b/src/CoreTests/document_store_usage_tests.cs @@ -160,6 +160,28 @@ public async Task event_store_usage_includes_global_aggregates_when_present() usage.GlobalAggregates.ShouldContain(g => g.FullName == typeof(User).FullName); } + // JasperFx/wolverine#5002: the database half of TryCreateUsage on its own, for Wolverine's heartbeat + [Fact] + public async Task describing_the_databases_alone_matches_the_usage() + { + var host = await BuildHost(opts => + { + opts.DatabaseSchemaName = $"{SchemaName}_describe_databases"; + }); + + var store = host.Services.GetRequiredService(); + + var databases = await store.TryDescribeDatabasesAsync(CancellationToken.None); + var usage = await store.TryCreateUsage(CancellationToken.None); + + databases.ShouldNotBeNull(); + databases.Cardinality.ShouldBe(usage!.Database.Cardinality); + databases.MainDatabase!.DatabaseName.ShouldBe(usage.Database.MainDatabase!.DatabaseName); + databases.MainDatabase.ServerName.ShouldBe(usage.Database.MainDatabase.ServerName); + databases.Databases.Select(x => x.DatabaseName) + .ShouldBe(usage.Database.Databases.Select(x => x.DatabaseName)); + } + private Task BuildHost(Action configure) { return StartHostAsync(configure); diff --git a/src/Marten/DocumentStore.EventStore.cs b/src/Marten/DocumentStore.EventStore.cs index 2844586631..3c6b8aab1a 100644 --- a/src/Marten/DocumentStore.EventStore.cs +++ b/src/Marten/DocumentStore.EventStore.cs @@ -644,6 +644,16 @@ async Task ISubscriptionRunner.ExecuteAsync(ISubscription subscri await session.ExecuteBatchAsync(batch, token).ConfigureAwait(false); } + /// + /// JasperFx/wolverine#5002 — just the database half of TryCreateUsage, straight from the tenancy. + /// Wolverine asks for it on every leader heartbeat, and the full usage also reads the highest event + /// sequence and describes every projection, subscription, event type and tag type. + /// + async Task IEventStore.TryDescribeDatabasesAsync(CancellationToken token) + { + return await Options.Tenancy.DescribeDatabasesAsync(token).ConfigureAwait(false); + } + async Task IEventStore.TryCreateUsage(CancellationToken token) { var usage = new EventStoreUsage(Subject, this)