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

MongoDB schema creation fails in AWS DocumentDB due to overly-long index name #788

Closed
jpars opened this issue Feb 18, 2019 · 4 comments
Closed
Labels

Comments

@jpars
Copy link
Contributor

@jpars jpars commented Feb 18, 2019

Hello,

When using MongoRepository with AWS DocumentDB, MongoSchemaManager.ensureSchema() fails to create the compound index of commitMetadata.properties.key and commitMetadata.properties.value in jv_snapshots, because the autogenerated index name is too long. Both MongoDB and DocumentDB limit the fully-qualified index name (<db>.<col>.$<index>) to under 128 characters, but DocumentDB places the additional restriction that the unqualified index name (<col>.$<index>) must be under 64 characters. In this case, the complete autogenerated index name, jv_snapshots.$commitMetadata.properties.key_1_commitMetadata.properties.value_1, exceeds that limit. This issue also occurs in MongoDB, if using an unusually long DB name.

Perhaps MongoSchemaManager.ensureSchema() could explicitly set a shorter index name?

Thanks!

@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Feb 18, 2019

ok, consider contributing a PR

@jpars
Copy link
Contributor Author

@jpars jpars commented Feb 19, 2019

PR is opened, however i just learned that this index isn't compatible with DocumentDB anyway, as it does not yet support compound indexes with multiple array fields. Amazon's docs seem to imply that this feature is coming, so maybe it's not worth addressing this issue until support is added. I can close the PR and perhaps follow up later if you prefer.

bartoszwalacik added a commit that referenced this issue Feb 19, 2019
#788 Explicitly set name for MongoDB snapshot commit property index
@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Feb 21, 2019

PR is merged. The index on commitProperties is quite important but maybe we can start with DocumentDB experimental support, so without this index in the first place.

bartoszwalacik added a commit that referenced this issue Feb 24, 2019
@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Feb 26, 2019

released in 5.2.4 as experimental support
see https://javers.org/documentation/repository-configuration/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants