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

limit windowing support snapshoted events #195

Merged
merged 5 commits into from
May 28, 2024

Conversation

Roiocam
Copy link
Member

@Roiocam Roiocam commented May 27, 2024

Motivation

it also fixed the test failed after #180 merged.

Explan

In the normal case...(the sequence version always start from 1)

Query pid = test-account-1, from = 1, to = 501, batch-size= 500
Query pid = test-account-1, from = 501, to = 1001, batch-size= 500
Query pid = test-account-1, from = 1001, to = 1501, batch-size= 500
Query pid = test-account-1, total = 1000

After the snapshot, the existing sequence version may start from 1000 or higher.(or something happened unexpectedly, like the migrator test)(the persistenceActor It will not be affected, because the Reply will query HigherSequenceNumber in advance, but queries such as currentEventsByPersistenceId can not be required)
In this case we should use full windows for the first query only.

- Query pid = test-account-1, from = 1, to = 501, batch-size= 500
+ Query pid = test-account-1, from = 1, to = 9223372036854775807, batch-size= 500
Query pid = test-account-1, from = 1501, to = 2001, batch-size= 500
Query pid = test-account-1, from = 2001, to = 2501, batch-size= 500
Query pid = test-account-1, total = 1000

@Roiocam Roiocam force-pushed the limit-windowing-validation branch from 2d185c5 to 7d4bdd4 Compare May 27, 2024 07:54
@Roiocam Roiocam changed the title force valid in limit windowing limit windowing support snapshoted events May 27, 2024
@Roiocam Roiocam marked this pull request as draft May 27, 2024 08:53
@Roiocam Roiocam marked this pull request as ready for review May 27, 2024 10:38
Copy link
Contributor

@nvollmar nvollmar left a comment

Choose a reason for hiding this comment

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

lgtm

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

val atomicWrites =
(start to end).map { j =>
AtomicWrite(immutable.Seq(PersistentRepr(payload, j, persistenceId)))
AtomicWrite(immutable.Seq(PersistentRepr(payload, j, persistenceId, writerUuid = writerUuid)))
Copy link
Member Author

Choose a reason for hiding this comment

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

Oracle not allow insert null writedUuid

@Roiocam
Copy link
Member Author

Roiocam commented May 28, 2024

Merged to verify #198

@Roiocam Roiocam merged commit 7939510 into apache:main May 28, 2024
23 checks passed
@Roiocam Roiocam deleted the limit-windowing-validation branch May 28, 2024 01:46
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.

3 participants