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

fix(mutation): validate mutation before applying it #8623

Merged
merged 1 commit into from
Jan 31, 2023
Merged

Conversation

mangalaman93
Copy link
Member

This change ensures that the value in the mutation is not too big. The challenge here is that the keys in badger have a limitation on their size (< 2<<16). We need to ensure that no key, either primary or secondary index key is bigger than that.

Fixes https://github.com/dgraph-io/projects/issues/73

@mangalaman93 mangalaman93 force-pushed the aman/65k branch 2 times, most recently from 89a6bc2 to f03394b Compare January 20, 2023 20:46
Base automatically changed from aman/vet to main January 20, 2023 21:47
@coveralls
Copy link

coveralls commented Jan 20, 2023

Coverage Status

Coverage: 67.069% (+0.2%) from 66.85% when pulling 397bac0 on aman/65k into c07f6fa on main.

edgraph/server.go Outdated Show resolved Hide resolved
edgraph/server.go Outdated Show resolved Hide resolved
@mangalaman93 mangalaman93 force-pushed the aman/65k branch 2 times, most recently from e5fb320 to bb0be52 Compare January 29, 2023 10:23
Copy link
Contributor

@harshil-goel harshil-goel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to look at what happens when indexing fails, as we can't just skip the transcation anymore.

worker/graphql_schema.go Show resolved Hide resolved
@mangalaman93
Copy link
Member Author

@harshil-goel indexing request comes as part of the Alter request and it is not a transaction. Today, it is acceptable that the indexing could fail. We don't have a good way of letting the user know yet and we should build one. The nice thing here is that the schema remains consistent either way.

This change ensures that the value in the mutation is
not too big. The challenge here is that the keys in
badger have a limitation on their size (< 2<<16). We
need to ensure that no key, either primary or secondary
index, is bigger than that.

Fixes dgraph-io/projects-internal#73
harshil-goel
harshil-goel previously approved these changes Jan 31, 2023
@mangalaman93 mangalaman93 merged commit c084617 into main Jan 31, 2023
@mangalaman93 mangalaman93 deleted the aman/65k branch January 31, 2023 16:50
all-seeing-code pushed a commit that referenced this pull request Feb 8, 2023
This change ensures that the value in the mutation is not too big. The
challenge here is that the keys in badger have a limitation on their
size (< 2<<16). We need to ensure that no key, either primary or
secondary index key is bigger than that.

Fixes https://github.com/dgraph-io/projects/issues/73
all-seeing-code pushed a commit that referenced this pull request Feb 8, 2023
This change ensures that the value in the mutation is not too big. The
challenge here is that the keys in badger have a limitation on their
size (< 2<<16). We need to ensure that no key, either primary or
secondary index key is bigger than that.

Fixes https://github.com/dgraph-io/projects/issues/73
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants