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

feat: Migration to replicated event sourcing #32438

Merged
merged 5 commits into from
Jun 19, 2024
Merged

Conversation

patriknw
Copy link
Member

@patriknw patriknw commented Jun 14, 2024

Refs #29261

es1 ! Stop

// then migrate to ReplicatedEventSourced, one replica must keep the same persistenceId
// as the original EventSourced, i.e. without replicaId
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The replicaId is part of the persistenceId so I think it's easiest to let the original remain as is. I used "" as indication of such replicaId.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth having a EmptyReplicaId or something for it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added in 0282c9d

* was located should be empty.
*/
val empty: ReplicaId = ReplicaId("")
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding this companion makes mima complain:

[error] akka-persistence-typed: Failed binary compatibility check against com.typesafe.akka:akka-persistence-typed_2.13:2.6.12! Found 3 potential problems (filtered 18)
[error]  * static method andThen(scala.Function1)scala.Function1 in class akka.persistence.typed.ReplicaId does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("akka.persistence.typed.ReplicaId.andThen")
[error]  * static method compose(scala.Function1)scala.Function1 in class akka.persistence.typed.ReplicaId does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("akka.persistence.typed.ReplicaId.compose")
[error]  * the type hierarchy of object akka.persistence.typed.ReplicaId is different in current version. Missing types {scala.runtime.AbstractFunction1}
[error]    filter with: ProblemFilters.exclude[MissingTypesProblem]("akka.persistence.typed.ReplicaId$")

Strange, I thought that wouldn't be a problem. What shall I do? Add mima filter? Rename to object EmptyReplicaId?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, yeah maybe best to make a separate case object.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh, huh, and that doesn't work because can't extend final case class, and extending a case class is not good in the first place

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so can we just implement the apply and extend AbstractFunction1 then and fulfil the existing contract?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added AbstractFunction1 to the companion.

@patriknw patriknw marked this pull request as ready for review June 18, 2024 14:19
Copy link
Member

@johanandren johanandren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@patriknw patriknw merged commit aea2679 into main Jun 19, 2024
5 checks passed
@patriknw patriknw deleted the wip-es-to-res-patriknw branch June 19, 2024 08:16
@patriknw patriknw added this to the 2.9.4 milestone Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants