Repository navigation
Add AddMartenHighWaterHealthCheck<TStore>() for stores registered with AddMartenStore - #5716
Merged
jeremydmiller merged 1 commit intoOct 19, 2026
Conversation
…h AddMartenStore The high-water health check resolved IDocumentStore, which is not registered when an application uses only AddMartenStore<TStore>(), so its first probe threw. autoRestart also only ever asked the unmarked coordinator. Two generic overloads mirror the existing two. Each registers a check named HighWaterHealthCheck:<store> that resolves TStore and restarts through IProjectionCoordinator<TStore>. Its settings travel with its own registration instead of replacing the HighWaterHealthCheckSettings singleton, which belongs to the default store's check. No existing signature changes. Closes #5705. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017FSnat2TKnusp6MdEZgpHj
jeremydmiller
deleted the
claude/5705-ancillary-high-water-health-check
branch
October 19, 2026 20:12
This was referenced Oct 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5705.
The bug
AddMartenHighWaterHealthCheck()only works with the default store fromAddMarten():HighWaterHealthChecktakesIDocumentStore, which isn't registered when an application uses onlyAddMartenStore<TStore>(). The first probe throwsUnable to resolve service for type 'Marten.IDocumentStore'.autoRestartonly ever resolved the unmarkedIProjectionCoordinator, neverIProjectionCoordinator<TStore>.The fix
Two generic overloads, mirroring the existing two (plain filter, and the provider-aware filter from #5061):
HighWaterHealthCheck:<store type>, tagged with the store's name.HighWaterHealthCheckExtensions.HighWaterHealthCheckNameFor<TStore>()returns that name.HighWaterHealthCheck<TStore>, a subclass that resolvesTStoreand overrides a new protectedresolveCoordinatorto useIProjectionCoordinator<TStore>.ReplacetheHighWaterHealthCheckSettingssingleton, so a generic overload doing the same would silently re-configure the default store's check.StoreName, so two stores never share a key even when they share a database.Binary compatibility
No existing signature changes. Everything here is new members: two overloads, one helper, one subclass, and a protected virtual. The generic overloads can't steal existing calls, because
TStorecan't be inferred, so a call has to name it.Tests
Marten.AspNetCore.Testing/high_water_health_check_for_ancillary_stores.cs. The hosts are built and never started, so a seeded high-water row stays put, which is the stalled agent the check reports.a_store_registered_only_through_AddMartenStore_can_be_probedthe_default_check_still_needs_the_default_storea_stalled_mark_on_the_ancillary_store_is_reportedauto_restart_goes_through_the_ancillary_stores_own_coordinatorIProjectionCoordinator<TStore>is the one askedeach_store_keeps_its_own_settings_and_trackingregistering_an_ancillary_check_does_not_reconfigure_the_default_oneTwo mutations confirm the tests have teeth:
registering_an_ancillary_check_does_not_reconfigure_the_default_one.auto_restart_goes_through_the_ancillary_stores_own_coordinator.These tests live in
Marten.AspNetCore.Testing, which CI runs. The existingHighWaterHealthCheckTestslive inDaemonTests.ManualOnly, which has no target inbuild/build.csand no CI job. They still pass locally (23/23) against this change.Local, net10.0:
Marten.AspNetCore.Testing: 122/122.Docs
docs/events/projections/healthchecks.mdgains a "Separate stores" section. It also notes that replacingHighWaterHealthCheckSettingsonly affects the default store's check.Generated by Claude Code