-
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
Overwrite values for uid predicates #4883
Conversation
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.
@martinmr could you please see why the CI is failing?
Reviewed 2 of 2 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @manishrjain and @martinmr)
b5d1cd8
to
bb470e9
Compare
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.
Fixed the failing tests.
Reviewable status: 1 of 2 files reviewed, 3 unresolved discussions (waiting on @golangcibot, @manishrjain, and @pawanrawal)
posting/list.go, line 343 at r1 (raw file):
Previously, golangcibot (Bot from GolangCI) wrote…
Error return value of
l.iterate
is not checked (fromerrcheck
)
Done.
posting/list.go, line 441 at r2 (raw file):
Previously, golangcibot (Bot from GolangCI) wrote…
File is not
gofmt
-ed with-s
(fromgofmt
)pk.IsData() && mpost.Op == Set && mpost.PostingType == pb.Posting_REF
Done.
posting/list.go, line 441 at r3 (raw file):
Previously, golangcibot (Bot from GolangCI) wrote…
File is not
gofmt
-ed with-s
(fromgofmt
)pk.IsData() && mpost.Op == Set && mpost.PostingType == pb.Posting_REF
Done.
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 1 of 2 files at r1, 1 of 1 files at r5.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @golangcibot and @martinmr)
posting/list.go, line 339 at r5 (raw file):
if singleUidUpdate { // This handles the special case when adding a value to predicates of type uid.
We have to do this, because the UID for a uid predicate would not be MaxUint64, as is the case for other non-list scalars. So, we need to delete the previous whatever UID is there and set this one.
posting/list.go, line 451 at r5 (raw file):
hex.EncodeToString(l.key), mpost) }
Ludicrous mode return might have to be moved here.
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.
Add a bunch of comments.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @golangcibot and @martinmr)
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.
Added more comments.
Reviewable status: 1 of 2 files reviewed, 5 unresolved discussions (waiting on @golangcibot and @manishrjain)
posting/list.go, line 339 at r5 (raw file):
Previously, manishrjain (Manish R Jain) wrote…
We have to do this, because the UID for a uid predicate would not be MaxUint64, as is the case for other non-list scalars. So, we need to delete the previous whatever UID is there and set this one.
Done.
posting/list.go, line 451 at r5 (raw file):
Previously, manishrjain (Manish R Jain) wrote…
Ludicrous mode return might have to be moved here.
Done.
When the warning to delete and re-add the value was removed, non-list uid predicates were not being overwritten. This fixes this by iterating over the list and replacing theexisting postings with a copy with the operation set to a delete. It also adds a test to prevent this from happening again. Fixes #4879
When the warning to delete and re-add the value was removed, non-list uid
predicates were not being overwritten. This fixes this by iterating over the list
and replacing theexisting postings with a copy with the operation set to a delete.
It also adds a test to prevent this from happening again.
Fixes #4879
This change is
Docs Preview: