Duplicate Segment Claim Warning

Hi,

I have two replicas of the same microservice. Both use PooledEventProcessors, the same MongoDB as a TokenStore and the same user to connect to said MongoDB. If I start the replicas one after another and then rebalance, everything works fine. But if I start up both replicas at the same time, I get a warning about duplicate segment claims on some event processors and on the console appear errors on one of the services which says “Invalid token type provided”. Is that caused by a wrong configuration of the services or do I need, in fact, to be careful with the deployment?

Best regards
Trutz

Hi again,

This problem became bigger now. After running three instances for three days without shutting down anything, I get the warnings mentioned above on nearly every event processor. In addition to that, some processors have another warning because not all segments are claimed. Starting and stopping the processors does not fix anything. The only solution was to restart all instances one after another.

Best regards,
Trutz

Would you be able to specify which version of Axon Framework you’re using?
In Axon 4.5, there was a minor bug in reporting the segment information from the PooledStreamingEventProcessor. This issue was resolved in, if I recall correctly, version 4.5.1.

On any note, the most recent version of Axon Framework is 4.5.3. I would recommend you to use this version if you aren’t already.

Hi Steven,

Thank you, this resolved the problem. But now to other issues occurred:

org.axonframework.eventhandling.tokenstore.UnableToClaimTokenException: Unable to extend claim on token token 'my-event-processor[0]'. It is owned by another segment.

and

Releasing claim of token MySagaProcessor/0 failed. It was owned by another node.

This happens frequently. It seems that the instances steal the token claims from each other. We now switched back to the TackingEventProcessors and everything seems to run fine, so it’s seemingly related to the PooledEventProcessors.

Best regards,
Trutz