-
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
Store namespace in predicate as a hex separated by a hyphen to prevent json marshal issues #8601
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
harshil-goel
requested review from
akon-dey,
MichelDiz,
matthewmcneely,
skrdgraph,
darkn3rd,
meghalims and
billprovince
as code owners
January 10, 2023 19:45
harshil-goel
changed the title
Harshil/manifest bug fix
Fix manifest update logic in dgraph after #7810
Jan 10, 2023
mangalaman93
added
the
slash-to-main
PRs which bring slash branch on par with main.
label
Jan 11, 2023
harshil-goel
force-pushed
the
harshil/manifest_bug_fix
branch
from
January 16, 2023 14:59
1680463
to
dc1ccb0
Compare
harshil-goel
changed the base branch from
harshil/manifest_tool
to
harshil/cp
January 16, 2023 15:00
Do we need this tool now? Can we not just make sure that we can do the upgrade ourselves in the process? |
mangalaman93
requested changes
Jan 19, 2023
matthewmcneely
requested changes
Jan 23, 2023
harshil-goel
force-pushed
the
harshil/cp
branch
from
January 30, 2023 04:08
3fccd72
to
fed155a
Compare
harshil-goel
force-pushed
the
harshil/manifest_bug_fix
branch
from
January 30, 2023 04:10
dc1ccb0
to
79347e7
Compare
harshil-goel
force-pushed
the
harshil/manifest_bug_fix
branch
3 times, most recently
from
February 1, 2023 10:39
8716ada
to
d954797
Compare
mangalaman93
reviewed
Feb 1, 2023
harshil-goel
force-pushed
the
harshil/manifest_bug_fix
branch
from
February 1, 2023 10:51
d954797
to
813c83c
Compare
mangalaman93
requested changes
Feb 1, 2023
harshil-goel
force-pushed
the
harshil/manifest_bug_fix
branch
from
February 2, 2023 04:41
813c83c
to
2cfd03d
Compare
harshil-goel
changed the title
Fix manifest update logic in dgraph after #7810
Store namespace in predicate as a hex separated by a hyphen to prevent json marshal issues
Feb 2, 2023
harshil-goel
force-pushed
the
harshil/manifest_bug_fix
branch
from
February 2, 2023 04:49
2cfd03d
to
95b0684
Compare
mangalaman93
requested changes
Feb 2, 2023
harshil-goel
force-pushed
the
harshil/manifest_bug_fix
branch
3 times, most recently
from
February 3, 2023 09:55
014b6fe
to
eea16be
Compare
mangalaman93
previously approved these changes
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)
harshil-goel
force-pushed
the
harshil/manifest_bug_fix
branch
from
February 3, 2023 10:05
eea16be
to
35103c8
Compare
mangalaman93
approved these changes
Feb 3, 2023
matthewmcneely
approved these changes
Feb 3, 2023
all-seeing-code
pushed a commit
that referenced
this pull request
Feb 8, 2023
…t json marshal issues (#8601) 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 using guardian of galaxy - Backup and List Backup - Http clients and Ratel - Schema and predicate 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: <namespace>-<attribute> (- is the hyphen literal) <namespace> is a string "81" in hex We also update the manifest version after update. This diff takes care that older backups are still compatible and can be used to restore. Contains: #7838 #7828 #7825 #7815 #7810
all-seeing-code
pushed a commit
that referenced
this pull request
Feb 8, 2023
…t json marshal issues (#8601) 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 using guardian of galaxy - Backup and List Backup - Http clients and Ratel - Schema and predicate 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: <namespace>-<attribute> (- is the hyphen literal) <namespace> is a string "81" in hex We also update the manifest version after update. This diff takes care that older backups are still compatible and can be used to restore. Contains: #7838 #7828 #7825 #7815 #7810
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
We used to store predicate as | (pipe | signifies concatenation). We store this as a string. 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:
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: - (- is the hyphen literal) is a string "81" in hex
We also update the manifest version after update. This diff takes care that older backups are still compatible and can be used to restore.