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

Configuring persistence plugins at runtime for EventSourcedBehavior #1518

Merged
merged 11 commits into from
Oct 16, 2024

Conversation

ptrdom
Copy link
Member

@ptrdom ptrdom commented Oct 6, 2024

Resolves #1513.

Copy link
Contributor

@pjfanning pjfanning left a comment

Choose a reason for hiding this comment

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

there are quite a lot of changes to constructors - even if they are for internal classes

I don't know but we might want to consider adding secondary constructors that match the existing param lists in the 1.1.2-RC1 release.

@@ -107,14 +113,18 @@ private[pekko] final class BehaviorSetup[C, E, S](

private var recoveryTimer: OptionVal[Cancellable] = OptionVal.None

val recoveryEventTimeout: FiniteDuration = persistence
Copy link
Contributor

Choose a reason for hiding this comment

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

private please

Copy link
Member Author

Choose a reason for hiding this comment

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

This is accessed in multiple places of EventSourcedBehavior state machine - ReplayingEvents and ReplayingSnapshot are using this to make error messages, so cannot be made private. Please advise if some different solution is required.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a @since 1.1.3 annotation to any new public classes, variables or functions?

Copy link
Member Author

Choose a reason for hiding this comment

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

Just double-checking - is this required for public members of classes marked with @InternalApi and private[pekko]?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure - this whole PR is looking like something we might need to stick in a future major release as opposed to an upcoming patch release. Leave the since annotations out for now.

Copy link
Member Author

Choose a reason for hiding this comment

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

Understood. Is there any issue with creating a PR with this code in Akka repository? Wondering about any potential license conflicts, would not want interaction with BSL repositories voiding Pekko of this code.

Copy link
Contributor

Choose a reason for hiding this comment

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

Feel free to submit this to Akka. You own this code and submitting it Akka does not change that. The problem will only arise if you collaborate on some of the code with a Lightbend employee and then take that collaboration and try to submit that to us.

@ptrdom ptrdom requested a review from pjfanning October 7, 2024 16:54
@pjfanning
Copy link
Contributor

There are binary compat problems that will require adding an exclude file for.

[error] pekko-persistence-typed: Failed binary compatibility check against org.apache.pekko:pekko-persistence-typed_2.12:1.0.0! Found 2 potential problems
[error]  * abstract method withJournalPluginConfig(scala.Option)org.apache.pekko.persistence.typed.scaladsl.EventSourcedBehavior in interface org.apache.pekko.persistence.typed.scaladsl.EventSourcedBehavior is present only in current version
[error]    filter with: ProblemFilters.exclude[ReversedMissingMethodProblem]("org.apache.pekko.persistence.typed.scaladsl.EventSourcedBehavior.withJournalPluginConfig")
[error]  * abstract method withSnapshotPluginConfig(scala.Option)org.apache.pekko.persistence.typed.scaladsl.EventSourcedBehavior in interface org.apache.pekko.persistence.typed.scaladsl.EventSourcedBehavior is present only in current version
[error]    filter with: ProblemFilters.exclude[ReversedMissingMethodProblem]("org.apache.pekko.persistence.typed.scaladsl.EventSourcedBehavior.withSnapshotPluginConfig")
[error] java.lang.RuntimeException: Failed binary compatibility check against org.apache.pekko:pekko-persistence-typed_2.12:1.0.0! Found 2 potential problems

@pjfanning pjfanning added this to the 1.1.3 milestone Oct 16, 2024
Copy link
Contributor

@pjfanning pjfanning left a comment

Choose a reason for hiding this comment

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

lgtm

@pjfanning
Copy link
Contributor

I think the mima excludes are ok for a 1.1.3 release. I guess some other contributor might object but at this stage this has been open for a while. I'll merge but we can re-review if someone comes back with issues.

@pjfanning pjfanning merged commit 4afe7cf into apache:main Oct 16, 2024
9 checks passed
@pjfanning
Copy link
Contributor

@raboof @mdedetrich do you think this causes issues for a 1.1.x release? I think Persistence APIs have been documented to be 'may change'. The bin compat issues in this PR do not appear to likely trouble anyone.

@raboof
Copy link
Member

raboof commented Nov 27, 2024

I can't find any reference to the type Persistence APIs being 'may change' - not in the code nor in the documentation.

However, since scaladsl.EventSourcedBehavior is marked @DoNotInherit, this change looks backwards compatible to me.

(we do encourage users inheriting from javadsl.EventSourcedBehavior, but that one has an implementation, so that's fine as well).

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.

Configuring persistence plugins at runtime for EventSourcedBehavior
3 participants