akka / akka-persistence-jdbc

Asynchronously writes journal and snapshot entries to configured JDBC databases so that Akka Actors can recover state
https://doc.akka.io/docs/akka-persistence-jdbc/
Other
309 stars 142 forks source link

Akka Persistence JDBC MySQL schema creation script warning on duplicate unique index #667

Open davidlzs opened 2 years ago

davidlzs commented 2 years ago

Versions used

Akka version:

Expected Behavior

Please describe the expected behavior of the issue, starting from the first action.

Actual Behavior

Please provide a description of what actually happens, working from the same starting point.

When using the MySQL schema creation script to create DB objects, we got the following MySQL warning:

09:10:13    CREATE UNIQUE INDEX event_journal_ordering_idx ON event_journal(ordering)   0 row(s) affected, 1 warning(s): 1831 Duplicate index 'event_journal_ordering_idx' defined on the table 'event_journal'. This is deprecated and will be disallowed in a future release. Records: 0  Duplicates: 0  Warnings: 1  0.016 sec

Relevant logs

If you identified a section in your logs that explains the bug or might be important to understand it, please add it.

Reproducible Test Case

Please provide a PR with a failing test.

If the issue is more complex or requires configuration, please provide a link to a project that reproduces the issue.

octonato commented 2 years ago

Did that happen after a second run of that script?

The create table has a IF NOT EXISTS clause so it's idempotent, but that's not the case for the index.

The is no IF NOT EXISTS clause for index creation. If we want to solve this, we will need to write a more complex script that checks the information_schema table.