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

ReplayStatus always false and @DisallowReplay not working for PooledStreamingEventProcessor #2154

Closed
oysteing opened this issue Mar 25, 2022 · 6 comments · Fixed by #2168
Closed
Assignees
Labels
Priority 1: Must Highest priority. A release cannot be made if this issue isn’t resolved. Status: Resolved Use to signal that work on this issue is done. Type: Bug Use to signal issues that describe a bug within the system.
Milestone

Comments

@oysteing
Copy link

Basic information

Steps to reproduce

  1. Start giftcard-demo modified in repo above
  2. Issue single card and redeem card (2 events)
  3. Initiate replay by pressing "Submit Bulk issue cards"

Expected behaviour

The expected behaviour is how the TrackingEventProcessor (axon.eventhandling.processors.card-summary.mode=tracking) works:

2022-03-25 11:37:17.268  INFO 24840 --- [nio-8080-exec-7] o.a.e.TrackingEventProcessor             : Shutdown state set for Processor 'card-summary'.
2022-03-25 11:37:17.269  INFO 24840 --- [nio-8080-exec-7] o.a.e.TrackingEventProcessor             : Processor 'card-summary' awaiting termination...
2022-03-25 11:37:17.622  INFO 24840 --- [card-summary]-0] o.a.e.TrackingEventProcessor             : Released claim
2022-03-25 11:37:17.623  INFO 24840 --- [card-summary]-0] o.a.e.TrackingEventProcessor             : Worker for segment Segment[1/1] stopped.
2022-03-25 11:37:17.651  INFO 24840 --- [card-summary]-1] o.a.e.TrackingEventProcessor             : Released claim
2022-03-25 11:37:17.651  INFO 24840 --- [card-summary]-1] o.a.e.TrackingEventProcessor             : Worker for segment Segment[0/1] stopped.
2022-03-25 11:37:17.665  INFO 24840 --- [card-summary]-2] o.a.e.TrackingEventProcessor             : Worker assigned to segment Segment[0/1] for processing
2022-03-25 11:37:17.666  INFO 24840 --- [card-summary]-2] o.a.e.TrackingEventProcessor             : Dispatching new tracking segment worker: TrackingSegmentWorker{processor=card-summary, segment=Segment[0/1]}
2022-03-25 11:37:17.666  INFO 24840 --- [card-summary]-2] o.a.e.TrackingEventProcessor             : Worker assigned to segment Segment[1/1] for processing
2022-03-25 11:37:17.666  INFO 24840 --- [card-summary]-3] o.a.e.TrackingEventProcessor             : Fetched token: ReplayToken{currentToken=null, tokenAtReset=IndexTrackingToken{globalIndex=1}} for segment: Segment[0/1]
2022-03-25 11:37:17.666  INFO 24840 --- [card-summary]-2] o.a.e.TrackingEventProcessor             : Using current Thread for last segment worker: TrackingSegmentWorker{processor=card-summary, segment=Segment[1/1]}
2022-03-25 11:37:17.667  INFO 24840 --- [card-summary]-2] o.a.e.TrackingEventProcessor             : Fetched token: ReplayToken{currentToken=null, tokenAtReset=IndexTrackingToken{globalIndex=1}} for segment: Segment[1/1]
2022-03-25 11:37:17.678  INFO 24840 --- [card-summary]-3] o.a.m.interceptors.LoggingInterceptor    : Incoming message: [CardIssuedEvent]
2022-03-25 11:37:17.679 DEBUG 24840 --- [card-summary]-3] i.a.d.g.query.CardSummaryProjection      : class io.axoniq.demo.giftcard.api.CardIssuedEvent handler called with replayStatus=REPLAY

Actual behaviour

Performing the same steps with PooledStreamingEventProcessor(axon.eventhandling.processors.card-summary.mode=pooled):

2022-03-25 11:38:51.969  INFO 24872 --- [nio-8080-exec-3] o.a.e.p.PooledStreamingEventProcessor    : Stopping processor [card-summary]
2022-03-25 11:38:51.985  INFO 24872 --- [nio-8080-exec-3] o.a.e.p.PooledStreamingEventProcessor    : Starting PooledStreamingEventProcessor [card-summary].
2022-03-25 11:38:51.986  INFO 24872 --- [card-summary]-0] o.a.eventhandling.pooled.Coordinator     : Processor [card-summary] claimed 2 new segments for processing
2022-03-25 11:38:51.994  INFO 24872 --- [card-summary]-1] o.a.m.interceptors.LoggingInterceptor    : Incoming message: [CardIssuedEvent]
2022-03-25 11:38:51.995 DEBUG 24872 --- [card-summary]-1] i.a.d.g.query.CardSummaryProjection      : class io.axoniq.demo.giftcard.api.CardIssuedEvent handler called with replayStatus=REGULAR
2022-03-25 11:38:51.995  INFO 24872 --- [card-summary]-1] o.a.m.interceptors.LoggingInterceptor    : [CardIssuedEvent] executed successfully with a [null] return value
2022-03-25 11:38:51.996  INFO 24872 --- [card-summary]-1] o.a.m.interceptors.LoggingInterceptor    : Dispatched messages: [CountChangedUpdate]
2022-03-25 11:38:52.001  INFO 24872 --- [card-summary]-1] o.a.m.interceptors.LoggingInterceptor    : Incoming message: [CardRedeemedEvent]
2022-03-25 11:38:52.002 DEBUG 24872 --- [card-summary]-1] i.a.d.g.query.CardSummaryProjection      : class io.axoniq.demo.giftcard.api.CardRedeemedEvent with @DisallowReplay handler called

The problematic part is the CardIssuedEvent handler called with replayStatus=REGULAR and the CardRedeemedEvent called although it has the @DisallowReplay annotation and a replay was performed.

@oysteing oysteing added the Type: Bug Use to signal issues that describe a bug within the system. label Mar 25, 2022
@CodeDrivenMitch CodeDrivenMitch self-assigned this Mar 28, 2022
@CodeDrivenMitch CodeDrivenMitch added Priority 1: Must Highest priority. A release cannot be made if this issue isn’t resolved. Status: In Progress Use to signal this issue is actively worked on. labels Mar 28, 2022
@smcvb smcvb added this to the Release 4.5.9 milestone Mar 28, 2022
@CodeDrivenMitch
Copy link
Member

Hello @oysteing , thanks for reporting the issue with us! I have investigated and the ReplayToken is not properly propagated to the messages in the UnitOfWork when using a PooledStreamingEventProcessor. We are working on fix, which will be released in 4.5.9.

CodeDrivenMitch added a commit that referenced this issue Mar 28, 2022
CodeDrivenMitch added a commit that referenced this issue Mar 28, 2022
CodeDrivenMitch added a commit that referenced this issue Mar 28, 2022
smcvb added a commit that referenced this issue Mar 29, 2022
[#2154] Fix missing propagation of ReplayToken to UnitOfWork for PooledStreamingEventProcessor
@close-label close-label bot added the Status: Resolved Use to signal that work on this issue is done. label Mar 29, 2022
@smcvb
Copy link
Member

smcvb commented Mar 29, 2022

Closing this issue, since it's resolved through pull request #2168.

@smcvb smcvb closed this as completed Mar 29, 2022
@smcvb smcvb removed the Status: In Progress Use to signal this issue is actively worked on. label Mar 29, 2022
@CodeDrivenMitch
Copy link
Member

Hello @oysteing, release 4.5.9 has been released containing the fix. Good luck on your project!

@oysteing
Copy link
Author

Thanks a lot for the quick fix and release. The fix seems to do the job. Will there also be a corresponding release of axon-bom?

@smcvb
Copy link
Member

smcvb commented Mar 30, 2022

Sure thing @oysteing! I imagine a BOM release to come in today, by the way. So, stay tuned!

@smcvb
Copy link
Member

smcvb commented Mar 30, 2022

The BOM's been released, @oysteing. It might take a little bit to get available, though.
I'm sure it'll be present tomorrow, though. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority 1: Must Highest priority. A release cannot be made if this issue isn’t resolved. Status: Resolved Use to signal that work on this issue is done. Type: Bug Use to signal issues that describe a bug within the system.
Projects
None yet
3 participants