-
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
Bugfix: Set found to false to avoid deleting index edge when value doesn't match. #3843
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.
✅ A review job has been created and sent to the PullRequest network.
@pawanrawal you can click here to see the review status or cancel the code review job.
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.
This changes seems to match the description and nice job updating the unit tests to match the expected
functionality.
Reviewed with ❤️ by PullRequest
@@ -331,7 +331,7 @@ func (txn *Txn) addMutationHelper(ctx context.Context, l *List, doUpdateIndex bo | |||
|
|||
if pFound && !(bytes.Equal(currPost.Value, newPost.Value) && | |||
types.TypeID(currPost.ValType) == types.TypeID(newPost.ValType)) { | |||
return val, found, emptyCountParams, err | |||
return val, false, emptyCountParams, nil |
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.
Would it be worth adding part of the comment from your PR description here just to help future readers of the code have that context? Otherwise it sticks out a little bit because every where else you return the found
variable.
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.
Merge after addressing the comments.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @manishrjain, @martinmr, and @pullrequest[bot])
posting/index.go, line 334 at r1 (raw file):
Previously, pullrequest[bot] wrote…
Would it be worth adding part of the comment from your PR description here just to help future readers of the code have that context? Otherwise it sticks out a little bit because every where else you return the
found
variable.
Agreed. Please add a comment here.
Fixes #3803
Return found as false to avoid deleting index corresponding to a uid when the value doesn't match. For scalar values, after fingerprinting found is always true as values get fingerprinted to
math.MaxUint64
. Hence we return found as false from this second check.This change is