Bugfix #530#531
Conversation
| { | ||
| } | ||
|
|
||
| [Fact] |
There was a problem hiding this comment.
Please file a GitHub issue to get this added to the TCK for Akka.Persistence.Query.
| _readJournalDao, | ||
| _readJournalConfig.JournalSequenceRetrievalConfiguration)), | ||
| name: $"{_readJournalConfig.TableConfig.EventJournalTable.Name}akka-persistence-sql-sequence-actor"); | ||
| name: $"{_readJournalConfig.PluginId}-{_readJournalConfig.TableConfig.EventJournalTable.Name}-akka-persistence-sql-sequence-actor"); |
There was a problem hiding this comment.
Actual fix.
Original intent:
We assume that users will only use this plugin to connect to one and only one database instance, the event journal table name was thought as unique enough an identifier for a read journal sequence actor name.
Problem:
Since Akka.Persistence.Sql can target multiple databases, it is possible that each database will use the same event journal table name and the naming convention will cause an actor name collision.
Note
Since we're using the read journal plugin id to make the actor name unique instead of the write journal plugin id, this does mean that we do not guarantee that there will only be a single read journal for a single write journal. User will need to be responsible for managing the number of read journal configurations and the read journal they instantiate to ensure system responsiveness.
|
|
||
| _log = Logging.GetLogger(system, $"{_readJournalConfig.PluginId}-{nameof(SqlReadJournal)}"); | ||
| _queryPermitter = system.ActorOf( | ||
| _queryPermitter = system.SystemActorOf( |
There was a problem hiding this comment.
Refactor all internal actors to system actors
| default); | ||
|
|
||
| _journalSequenceActor = system.ActorOf( | ||
| _journalSequenceActor = system.SystemActorOf( |
There was a problem hiding this comment.
Refactor all internal actors to system actors
| /// <summary> | ||
| /// Note that this is safe to do because the only place this is being called is | ||
| /// inside the `PersistenceQuery.ReadJournalFor{T}()` public method inside | ||
| /// Akka.Persistence.Query and the result of that method call is then cached | ||
| /// and reused for the duration of the ActorSystem lifetime. | ||
| /// </summary> | ||
| /// <returns> | ||
| /// A new instance of IReadJournal specific to this persistence plugin. | ||
| /// </returns> | ||
| [InternalApi] |
There was a problem hiding this comment.
Add explanation why this is safe to do
Changes