Add per-plugin recovery permitter actors - #7448
Merged
Aaronontheweb merged 4 commits intoJan 8, 2025
Merged
Conversation
Aaronontheweb
requested changes
Jan 8, 2025
Aaronontheweb
left a comment
Member
There was a problem hiding this comment.
Design looks good - but we should add some specs:
- Validate that we look for a plugin-specific
max-concurrent-recoveriesand that that can override the global default - Validate, with a quick test against the
Persistenceextension itself, that multiple recovery permitter actors are created if multiple journals are defined.
No need for a big End2End integration spec, I think that should be fine.
| /// </summary> | ||
| public IActorRef Journal => _journal ??= Extension.JournalFor(JournalPluginId); | ||
|
|
||
| internal IActorRef RecoveryPermitter => _recoveryPermitter ??= Extension.RecoveryPermitterFor(JournalPluginId); |
|
|
||
| public Config Config { get; } | ||
|
|
||
| public IActorRef RecoveryPermitter { get; } |
| var config = system.Settings.Config.GetConfig(configPath).WithFallback(system.Settings.Config.GetConfig(fallbackPath)); | ||
| var plugin = CreatePlugin(system, configPath, config); | ||
| var adapters = CreateAdapters(system, configPath); | ||
| var recoveryPermitter = CreateRecoveryPermitter(system, configPath, config); |
Arkatufus
commented
Jan 8, 2025
| private readonly IStash _internalStash; | ||
| private IActorRef _snapshotStore; | ||
| private IActorRef _journal; | ||
| private IActorRef _recoveryPermitter; |
Contributor
Author
There was a problem hiding this comment.
The recovery permitter is being cached here instead of in the Persistence extension. This is lazily created when the plugin is initialized for the first time.
| /// </summary> | ||
| public IActorRef Journal => _journal ??= Extension.JournalFor(JournalPluginId); | ||
|
|
||
| internal IActorRef RecoveryPermitter => _recoveryPermitter ??= Extension.RecoveryPermitterFor(JournalPluginId); |
Contributor
Author
There was a problem hiding this comment.
Lazy instantiation
| Ref = @ref; | ||
| Adapters = adapters; | ||
| Config = config; | ||
| RecoveryPermitter = recoveryPermitter; |
Contributor
Author
There was a problem hiding this comment.
Recovery permitter is also cached inside the PluginHolder so that it can be looked up.
| /// from being overloaded by limiting number of recoveries that can be in progress at the same time. | ||
| /// </summary> | ||
| internal IActorRef RecoveryPermitter() | ||
| internal IActorRef RecoveryPermitterFor(string journalPluginId) |
Contributor
Author
There was a problem hiding this comment.
Same design as AdaptersFor() to look up recovery permitter actor per plugin basis
…fus/akka.net into Add-per-plugin-recovery-permitter
Contributor
Author
|
Done adding spec |
Aaronontheweb
enabled auto-merge (squash)
January 8, 2025 19:57
Aaronontheweb
disabled auto-merge
January 8, 2025 20:29
This was referenced Oct 7, 2025
This was referenced Oct 7, 2025
This was referenced Nov 6, 2025
This was referenced Feb 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.
Fixes #7447
Changes
All changes are applied to internal APIs.
Persistenceextension to eachEventSourcedactors.RecoveryPermitteractor is now lazily created and stored inside persistencePluginHolderChecklist
For significant changes, please ensure that the following have been completed (delete if not relevant):