-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto initialization of tables isn't supported from the read journal side. #344
Comments
I suspect this line should be moved above on top of the method
|
Two questions for @Aaronontheweb and @Arkatufus:
|
There are problems implementing database table initializer for the read journal. In the old Sql.Common implementation, all table operations (both read and write) were implemented inside the journal actor, this allows for command stashing for all operations, allowing the journal to complete any database initialization before processing any database operations. In Akka.Persistence.Sql, the read journal accesses the database directly, giving it a performance boost. The problem with this design is that there's no mechanism we can tap into to make sure that the database tables are initialized. |
I understand the challenges how ever I don't agree with the outcome at least the exception should be handled in someway. Please reopen @Aaronontheweb @Arkatufus |
Fair point, we should handle the exception at least |
Version Information
Version of Akka.NET?
1.5.14
Which Akka.NET Modules?
Akka.Persistence.Sql
Describe the bug
I am using the new LINQ to db persistence with hocon config. I am initializing my tables with auto-initialize = true.
But this only happens if any actors attempt to persist something. In my case I also start a read journal. Then read journal complains the tables don't exist yet. Since no events are persisted yet. Surprisingly though the tables are created after read journal throws.
I have configured auto-initialize for the read journal as below
But I saw that auto-initialize isn't a supported config option for query.journal.sql. From the code I saw that, initilializing is done by
SqlWriteJournal. So either provide a programmatic way to force generating tables or better make sure read journal has also ability to generate the tables in case it is started before.
To Reproduce
Just try to use a read journal without persisting any events.
Links to working reproductions on Github / Gitlab are very much appreciated
Expected behavior
I would like readjournal not to fail with table don't exist error without persisting a dummy event.
Actual behavior
Read journal throws an exception when reading events. But somehow tables are created then.
Environment
Linux, docker .NET 8
Are you running on Linux? Windows? Docker? Which version of .NET?
The text was updated successfully, but these errors were encountered: