-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
auto-index-creation will block app to start when one Mongo cluster node is offline #4657
Comments
That is likely and blocking the application can also happen on application startup if the MongoDB server isn't available. We generally recommend not using auto-index creation because of operational aspects like these and therefore, the feature is deprecated. |
Hi @mp911de thanks for your reply, do you have any suggestions for replacement if not use auto index feature? |
Please either use programmatic index creation or create indexes out of band by running scripts against MongoDB via e.g. the shell. |
Programmatic index creation also need spring data mongodb add support to override commitQuorum option. template.indexOps(Person.class) |
We use These aren't typically the options Spring Data is working with. |
|
As title, we find an issue if we enable auto-index-creation as true, it will block app to start, if one of Mongo node offline.
The root cause is default value of commitQuorum is "votingMembers": all data-bearing voting replica set members
while one of voting member is down, so this command will never return. It block whole app to start.
We need set it as 1, look like set it as 1, it will also snyc to offline node when it come to online.
While Spring data Mongo didn't prviode function to override this option "commitQuorum".
refer: https://www.mongodb.com/docs/v5.3/reference/command/createIndexes/
The text was updated successfully, but these errors were encountered: