-
Type: Improvement
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Component/s: Core MongoDB
-
Release Notes Summary:The MongoDB sequenceHexRandomized retry mechanism has a maximum duration of 250 ms.
-
Tags:
-
Backlog priority:800
-
Team:PLATFORM
-
Sprint:nxplatform #122, nxplatform #123
-
Story Points:3
When using an idType of based on a random hex sequence (sequenceHexRandomized), under high concurrency (240 threads on 6 nodes) it has been seen that lots of threads are waiting and failing with a ConcurrentUpdateException while asking for a sequence.
org.nuxeo.ecm.core.api.ConcurrentUpdateException: Failed to update randomized sequence at org.nuxeo.ecm.core.storage.mongodb.MongoDBConnection.updateRandomizedSequence(MongoDBConnection.java:403) at org.nuxeo.ecm.core.storage.mongodb.MongoDBConnection.getNextSequenceId(MongoDBConnection.java:330)
Today the retry using a jitter and an exponential backoff that can take minutes before failing and the retry delay is greater than 16s, this is bad to handle concurrency, the backoff should have a maximum duration between retry fixed to something like 250ms.