Skip to content
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

Add support for performing writes using legacy serialization #107

Closed
Aaronontheweb opened this issue Feb 4, 2020 · 1 comment · Fixed by #108
Closed

Add support for performing writes using legacy serialization #107

Aaronontheweb opened this issue Feb 4, 2020 · 1 comment · Fixed by #108
Assignees
Milestone

Comments

@Aaronontheweb
Copy link
Member

Version: Akka.Persistence.MongoDb v1.4.0-beta2

Proposal is to add a feature flag to allow users who've been using the legacy BSON serialization for MongoDb to continue doing so despite #72 (comment)

The primary use case this is intended to address is the legacy data issue:

What am I supposed to do with all of my historically saved data in MongoDB?

We're going to work on that and see if it's possible, through the use of Akka.Peristence EventAdapters or something along those lines to provide forward compatibility for older events. Ideally, we would like to not have anyone stranded on an old version of Akka.Persistence and this is a problem we're going to have to solve across multiple plugins.

Reads in Akka.Persistence.MongoDb are already forwards compatible, so that's not a problem.

However, writes automatically default to protobuf serialization right now - because that's the only way to feasibly support issues like IActorRef serialization for Akka.Cluster.Sharding and so on.

We'll add a feature flag to the MongoDb driver along the lines of:

akka.persistence.mongodb{
   journal{
    legacy-serialization = off
  }

  snapshot-store{
   legacy-serialization = off
 }
}

If you opt into using this feature, you're acknowledging that "yes, I know Akka.Cluster.Sharding, AtLeastOnceDeliveryActors, and so on may not work properly - I am ok with that."

@Aaronontheweb Aaronontheweb added this to the v1.4.0-beta3 milestone Feb 4, 2020
@Aaronontheweb Aaronontheweb self-assigned this Feb 4, 2020
@Aaronontheweb
Copy link
Member Author

Working on an implementation for this now.

Aaronontheweb added a commit to Aaronontheweb/Akka.Persistence.MongoDB that referenced this issue Feb 4, 2020
Aaronontheweb added a commit that referenced this issue Feb 5, 2020
* working on #107 - adding legacy serialization feature flag

* standardized onto Akka.NET v1.4.0-beta4

* added spec for backwards-compat mode

* added legacy serialization journal plus spec

* implemented legacy snapshots

* disabled serialization on MongoDbLegacySerializationSnapshotStoreSpec

* updated README to include legacy-serialization notes

* disabling legacy spec until akkadotnet/akka.net#4190 gets released
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant