Limit number of concurrent PersistentActor recoveries, #22638 (#22641)

When starting many persistent actors at the same time the journal
its data store is protected from being overloaded by limiting number
of recoveries that can be in progress at the same time.

(cherry picked from commit afc9df17a7faf2a239598788ff48f3bf2cd7b605)
This commit is contained in:
Patrik Nordwall 2017-04-24 18:00:56 +02:00
parent cdd56a21a9
commit c385f163d9
8 changed files with 402 additions and 8 deletions

View file

@ -150,8 +150,14 @@ Recovery
--------
By default, a persistent actor is automatically recovered on start and on restart by replaying journaled messages.
New messages sent to a persistent actor during recovery do not interfere with replayed messages. New messages will
only be received by a persistent actor after recovery completes.
New messages sent to a persistent actor during recovery do not interfere with replayed messages.
They are stashed and received by a persistent actor after recovery phase completes.
The number of concurrent recoveries of recoveries that can be in progress at the same time is limited
to not overload the system and the backend data store. When exceeding the limit the actors will wait
until other recoveries have been completed. This is configured by::
akka.persistence.max-concurrent-recoveries = 50
.. note::
Accessing the sender with ``getSender()`` for replayed messages will always result in a ``deadLetters`` reference,