-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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(state): fix hex to uint64 response of list of namespaces #8091
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
the
area/graphql
Issues related to GraphQL support on Dgraph.
label
Oct 28, 2021
danielmai
approved these changes
Oct 29, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @manishrjain)
NamanJain8
added a commit
that referenced
this pull request
Nov 30, 2021
There is an issue in ExtractNamespaceFromPredicate. The issue is the parsing was done assuming ns in <ns>-<attr> to be decimal (actually it is hexadecimal). This leads to the following issues. A predicate a-name, it was skipped. A predicate 11-name was parsed as namespace 11, actually it is namespace 17 (0x11). (cherry picked from commit 0c9f601)
NamanJain8
added a commit
that referenced
this pull request
Nov 30, 2021
…8101) There is an issue in ExtractNamespaceFromPredicate. The issue is the parsing was done assuming ns in <ns>-<attr> to be decimal (actually it is hexadecimal). This leads to the following issues. A predicate a-name, it was skipped. A predicate 11-name was parsed as namespace 11, actually it is namespace 17 (0x11). (cherry picked from commit 0c9f601)
harshil-goel
pushed a commit
that referenced
this pull request
Jan 13, 2023
There is an issue in ExtractNamespaceFromPredicate. The issue is the parsing was done assuming ns in <ns>-<attr> to be decimal (actually it is hexadecimal). This leads to the following issues. A predicate a-name, it was skipped. A predicate 11-name was parsed as namespace 11, actually it is namespace 17 (0x11).
harshil-goel
pushed a commit
that referenced
this pull request
Jan 30, 2023
There is an issue in ExtractNamespaceFromPredicate. The issue is the parsing was done assuming ns in <ns>-<attr> to be decimal (actually it is hexadecimal). This leads to the following issues. A predicate a-name, it was skipped. A predicate 11-name was parsed as namespace 11, actually it is namespace 17 (0x11).
harshil-goel
pushed a commit
that referenced
this pull request
Jan 31, 2023
There is an issue in ExtractNamespaceFromPredicate. The issue is the parsing was done assuming ns in <ns>-<attr> to be decimal (actually it is hexadecimal). This leads to the following issues. A predicate a-name, it was skipped. A predicate 11-name was parsed as namespace 11, actually it is namespace 17 (0x11).
harshil-goel
pushed a commit
that referenced
this pull request
Feb 2, 2023
There is an issue in ExtractNamespaceFromPredicate. The issue is the parsing was done assuming ns in <ns>-<attr> to be decimal (actually it is hexadecimal). This leads to the following issues. A predicate a-name, it was skipped. A predicate 11-name was parsed as namespace 11, actually it is namespace 17 (0x11).
harshil-goel
pushed a commit
that referenced
this pull request
Feb 3, 2023
We used to store predicate as <namespace>|<attribute> (pipe | signifies concatenation). We store this as a string. <namespace> is 8 bytes uint64, which when marshaled to JSON bytes mess up the predicate. This is because for the namespace greater than 127, the UTF-8 encoding might take up several bytes (also if the mapping does not exist, then it replaces it with some other rune). This affects three identified places in Dgraph: Live loader Backup and List Backup Http clients and Ratel Fix: Fix is to have a UTF-8 string when dealing with JSON. A better idea is to use UTF-8 string even for internal operations. Only when we read/write to badger we convert it into the format of the byte. New Format: <anmespace>-<attribute> (- is the hyphen literal) fix(restore): update the schema and type from 2103 (#7838) With #7810 change, we changed the format of the predicate. We missed updating the schema and predicate. This PR fixes it. fix(state): fix hex to uint64 response of list of namespaces (#8091) There is an issue in ExtractNamespaceFromPredicate. The issue is the parsing was done assuming ns in <ns>-<attr> to be decimal (actually it is hexadecimal). This leads to the following issues. A predicate a-name, it was skipped. A predicate 11-name was parsed as namespace 11, actually it is namespace 17 (0x11). fix(backup): handle manifest version logic, update manifest version to 2105 (#7825) The backward compatibility of the backup's manifest was broken by #7810, although the tool was added (#7815) that enables smooth migration of manifest. This PR makes backup backward compatible, by updating the manifest(in-memory) after reading. fix(updatemanifest): update the version of manifest after update (#7828) We were not updating the manifest version after the updation. This PR fixes that.
harshil-goel
pushed a commit
that referenced
this pull request
Feb 3, 2023
We used to store predicate as <namespace>|<attribute> (pipe | signifies concatenation). We store this as a string. <namespace> is 8 bytes uint64, which when marshaled to JSON bytes mess up the predicate. This is because for the namespace greater than 127, the UTF-8 encoding might take up several bytes (also if the mapping does not exist, then it replaces it with some other rune). This affects three identified places in Dgraph: Live loader Backup and List Backup Http clients and Ratel Fix: Fix is to have a UTF-8 string when dealing with JSON. A better idea is to use UTF-8 string even for internal operations. Only when we read/write to badger we convert it into the format of the byte. New Format: <anmespace>-<attribute> (- is the hyphen literal) fix(restore): update the schema and type from 2103 (#7838) With #7810 change, we changed the format of the predicate. We missed updating the schema and predicate. This PR fixes it. fix(state): fix hex to uint64 response of list of namespaces (#8091) There is an issue in ExtractNamespaceFromPredicate. The issue is the parsing was done assuming ns in <ns>-<attr> to be decimal (actually it is hexadecimal). This leads to the following issues. A predicate a-name, it was skipped. A predicate 11-name was parsed as namespace 11, actually it is namespace 17 (0x11). fix(backup): handle manifest version logic, update manifest version to 2105 (#7825) The backward compatibility of the backup's manifest was broken by #7810, although the tool was added (#7815) that enables smooth migration of manifest. This PR makes backup backward compatible, by updating the manifest(in-memory) after reading. fix(updatemanifest): update the version of manifest after update (#7828) We were not updating the manifest version after the updation. This PR fixes that.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There is an issue in
ExtractNamespaceFromPredicate
. The issue is the parsing was done assumingns
in<ns>-<attr>
to be decimal (actually it is hexadecimal). This leads to the following issues.a-name
, it was skipped.11-name
was parsed as namespace 11, actually it is namespace 17 (0x11).This change is