-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Hello,
When I'm trying to use the distributed Mongo lock I always end up with IndexOptionsConflict
:
Caused by: com.mongodb.MongoCommandException: Command failed with error 85 (IndexOptionsConflict): 'Index already exists with a different name: lockedBy' on server localhost:27017. The full response is {"ok": 0.0, "errmsg": "Index already exists with a different name: lockedBy", "code": 85, "codeName": "IndexOptionsConflict"}
The app starts correctly, but once it tries to obtain the lock it always fails here
Index indexToEnsure = (new Index("lockedBy", Direction.ASC)).named("Lock_lockedBy").unique();
Using auto-configuration (not configuring anything).
Versions :
distributed-lock-mongodb-spring-boot-starter : 2.7.18
spring-boot : 2.7.4
Any idea what I'm doing wrong ? Shouldn't it just use the index instead of trying to create new one ?
Thanks,
Martin.
Metadata
Metadata
Assignees
Labels
No labels