Giter Site home page Giter Site logo

akka.persistence.mysql's People

Contributors

aaronontheweb avatar alexvaluyskiy avatar arkatufus avatar danthar avatar dependabot[bot] avatar diequeeq avatar eaba avatar horusiath avatar joshgarnett avatar sean-gilliam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

akka.persistence.mysql's Issues

Tests fail with error Unknown database 'akka_persistence_tests'

Steps to reproduce:

  1. Update TestDb connection string in src\Akka.Persistence.MySql.Tests\app.config
  2. Connect to MySql database and drop schema 'akka_persistence_tests'
  3. Run tests from Akka.Persistence.MySql.Tests project

Actual result:

Many tests fail with exception:
MySql.Data.MySqlClient.MySqlException
Authentication to host 'localhost' for user 'root' using method 'mysql_native_password' failed with message: Unknown database 'akka_persistence_tests'
at MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.AuthenticationFailed(Exception ex)
at MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.ReadPacket()
at MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.Authenticate(Boolean reset)
at MySql.Data.MySqlClient.NativeDriver.Open()
at MySql.Data.MySqlClient.Driver.Open()
at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
at MySql.Data.MySqlClient.MySqlPool.GetConnection()
at MySql.Data.MySqlClient.MySqlConnection.Open()
at Akka.Persistence.MySql.Tests.DbUtils.Initialize() in ...\src\Akka.Persistence.MySql.Tests\DbUtils.cs:line 28

Expected result:

Tests create schema when schema is missing.

The code creating database actually exists but it doesn't execute because connection fails to open when the specified database is missing. I assume config should be updated so that database name is specified separately from connection string

Use MySqlConnector for async I/O

The AbstractQueryExecutor code uses ExecuteReaderAsync. It's a long-standing bug in MySql.Data (bug 70111) that the async I/O methods are not implemented; thus all these methods will fall back to running synchronously. (See also here and here on Stack Overflow.)

To fix this, you could switch to https://github.com/mysql-net/MySqlConnector, an OSS replacement for MySql.Data that supports true asynchronous I/O.

If you're interested in this, I'd be happy to open a PR.

Akka.Persistence fails to save snapshot when data is bigger than 65,535 bytes

When snapshot data is bigger than 65,535 bytes, following error is observed in logs:
Failed to save snapshot, Error: MySql.Data.MySqlClient.MySqlException (0x80004005): Data too long for column 'snapshot' at row 1
at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId)
at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int64& insertedId)
at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
at System.Data.Common.DbCommand.ExecuteNonQueryAsync(CancellationToken cancellationToken)

create db error

When I run the application. It always throw this error.
repo: https://github.com/heyixiaoran/AkkaTest/tree/test

[ERROR][2018/11/13 2:36:56][Thread 0004][akka://actor-system/system/akka.persistence.journal.sharding] Error while creating actor instance of type Akka.Persistence.MySql.Journal.MySqlJournal with 1 args: ( class : "Akka.Persistence.MySql.Journal.MySqlJournal, Akka.Persistence.MySql"
plugin-dispatcher : akka.actor.default-dispatcher
connection-string : Server=localhost;Port=3306;Database=akka;Uid=root;Pwd=123456;
connection-timeout : 30s
table-name : sharding_journal
auto-initialize : on
timestamp-provider : "Akka.Persistence.Sql.Common.Journal.DefaultTimestampProvider, Akka.Persistence.Sql.Common"
metadata-table-name : sharding_metadata
)
Cause: [akka://actor-system/system/akka.persistence.journal.sharding#777175266]: Akka.Actor.ActorInitializationException: Exception during creation ---> System.TypeLoadException: Error while creating actor instance of type Akka.Persistence.MySql.Journal.MySqlJournal with 1 args: ( class : "Akka.Persistence.MySql.Journal.MySqlJournal, Akka.Persistence.MySql"
plugin-dispatcher : akka.actor.default-dispatcher
connection-string : Server=localhost;Port=3306;Database=akka;Uid=root;Pwd=123456;
connection-timeout : 30s
table-name : sharding_journal
auto-initialize : on
timestamp-provider : "Akka.Persistence.Sql.Common.Journal.DefaultTimestampProvider, Akka.Persistence.Sql.Common"
metadata-table-name : sharding_metadata
) ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'Void Akka.Persistence.Sql.Common.Journal.QueryConfiguration..ctor(System.String, System.String, System.String, System.String, System.String, System.String, System.String, System.String, System.String, System.String, System.String, System.String, System.TimeSpan, System.String)'.
at Akka.Persistence.MySql.Journal.MySqlJournal..ctor(Config journalConfig)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, Object[] args)
at Akka.Actor.Props.ActivatorProducer.Produce()
at Akka.Actor.Props.NewActor()
--- End of inner exception stack trace ---
at Akka.Actor.Props.NewActor()
at Akka.Actor.ActorCell.CreateNewActorInstance()
at Akka.Actor.ActorCell.<>c__DisplayClass109_0.b__0()
at Akka.Actor.ActorCell.UseThreadContext(Action action)
at Akka.Actor.ActorCell.NewActor()
at Akka.Actor.ActorCell.Create(Exception failure)
--- End of inner exception stack trace ---
at Akka.Actor.ActorCell.Create(Exception failure)
at Akka.Actor.ActorCell.SysMsgInvokeAll(EarliestFirstSystemMessageList messages, Int32 currentState)
[ERROR][2018/11/13 2:36:56][Thread 0004][akka://actor-system/system/akka.persistence.snapshot-store.sharding] Error while creating actor instance of type Akka.Persistence.MySql.Snapshot.MySqlSnapshotStore with 1 args: ( class : "Akka.Persistence.MySql.Snapshot.MySqlSnapshotStore, Akka.Persistence.MySql"
plugin-dispatcher : akka.actor.default-dispatcher
connection-string : Server=localhost;Port=3306;Database=akka;Uid=root;Pwd=123456;
connection-timeout : 30s
table-name : snapshot_store
auto-initialize : on
)
Cause: [akka://actor-system/system/akka.persistence.snapshot-store.sharding#464385363]: Akka.Actor.ActorInitializationException: Exception during creation ---> System.TypeLoadException: Error while creating actor instance of type Akka.Persistence.MySql.Snapshot.MySqlSnapshotStore with 1 args: ( class : "Akka.Persistence.MySql.Snapshot.MySqlSnapshotStore, Akka.Persistence.MySql"
plugin-dispatcher : akka.actor.default-dispatcher
connection-string : Server=localhost;Port=3306;Database=akka;Uid=root;Pwd=123456;
connection-timeout : 30s
table-name : snapshot_store
auto-initialize : on
) ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'Void Akka.Persistence.Sql.Common.Snapshot.QueryConfiguration..ctor(System.String, System.String, System.String, System.String, System.String, System.String, System.String, System.String, System.TimeSpan, System.String)'.
at Akka.Persistence.MySql.Snapshot.MySqlSnapshotStore..ctor(Config config)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, Object[] args)
at Akka.Actor.Props.ActivatorProducer.Produce()
at Akka.Actor.Props.NewActor()
--- End of inner exception stack trace ---
at Akka.Actor.Props.NewActor()
at Akka.Actor.ActorCell.CreateNewActorInstance()
at Akka.Actor.ActorCell.<>c__DisplayClass109_0.b__0()
at Akka.Actor.ActorCell.UseThreadContext(Action action)
at Akka.Actor.ActorCell.NewActor()
at Akka.Actor.ActorCell.Create(Exception failure)
--- End of inner exception stack trace ---
at Akka.Actor.ActorCell.Create(Exception failure)
at Akka.Actor.ActorCell.SysMsgInvokeAll(EarliestFirstSystemMessageList messages, Int32 currentState)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.