-
Notifications
You must be signed in to change notification settings - Fork 12
Make UncommittedHistory remember only successfully applied events
#1439
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
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## master #1439 +/- ##
============================================
+ Coverage 91.41% 91.45% +0.03%
+ Complexity 4946 4944 -2
============================================
Files 622 622
Lines 15216 15196 -20
Branches 891 891
============================================
- Hits 13910 13897 -13
+ Misses 1001 994 -7
Partials 305 305 |
62eacbd to
1efbae3
Compare
UncommittedHistory contain only successfully applied events
UncommittedHistory contain only successfully applied eventsAggregate put only successfully applied events to UncommittedHistory
…ers' into fix-uncommitted-list # Conflicts: # license-report.md # pom.xml # server/src/main/java/io/spine/server/BoundedContext.java # server/src/main/java/io/spine/server/aggregate/Aggregate.java # server/src/main/java/io/spine/server/aggregate/AggregateRepository.java # server/src/main/java/io/spine/server/aggregate/UncommittedHistory.java # server/src/main/java/io/spine/server/event/EventBus.java # server/src/testFixtures/java/io/spine/server/aggregate/given/AbstractAggregateResilienceTestEnv.java # server/src/testFixtures/java/io/spine/server/aggregate/given/employee/DispatchExhaust.java # server/src/testFixtures/java/io/spine/server/aggregate/given/employee/EmployeeAgg.java # server/src/testFixtures/java/io/spine/server/aggregate/given/employee/Employees.java # server/src/testFixtures/java/io/spine/server/aggregate/given/employee/PreparedInboxStorage.java # server/src/testFixtures/java/io/spine/server/aggregate/given/employee/PreparedStorageFactory.java # server/src/testFixtures/java/io/spine/server/aggregate/given/employee/package-info.java # version.gradle.kts
Contributor
|
Closing as outdated. The related issue will be resolved later. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses #1313.
The issue appears when multiple messages are dispatched from
Inbox. Under the hood, those messages are processed as a batch, which triggersAggregateto be cached for their processing. Going this way,Aggregateputs applied events intoUncommittedHistoryto send them to a storage lately.Now, events emitted by a single command are put into the history only if they all were applied successfully. This behavior matches to the one of non-cached
Aggregate.Additionally, initialization of
Deliverywas dropped out ofServerEnvironment.reset().Deliveryis lazily initialized the same way in its getterServerEnvironment.delivery().