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

Comments

Projects
None yet
2 participants
@jpars
Copy link
Contributor

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

This comment has been minimized.

Copy link
Member

bartoszwalacik commented Feb 18, 2019

ok, consider contributing a PR

@jpars

This comment has been minimized.

Copy link
Contributor Author

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

Merge pull request #790 from jpars/issue-788
#788 Explicitly set name for MongoDB snapshot commit property index
@bartoszwalacik

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Member

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
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.