-
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(Dgraph): check for deleteBelowTs in pIterator.valid #7288
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.
Reviewed 1 of 1 files at r1.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @manishrjain 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.
Can you add a test for this?
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @manishrjain 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.
This PR needs a better description.
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 2 of 2 files at r2.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @martinmr and @vvbalaji-dgraph)
Fixes DGRAPH-2705.
To reproduce, first insert a large number of edges of the form:
and then delete all of them:
After this, we can still see a few edges left despite the delete succeeding.
The reason this happens is that each
part
in apIterator
is initialized with avalid
function, which checks if the iterator is currently on a valid block of UIDs, and skips to the next valid block if not. In contrast, thenext
function advances to the next valid block regardless of whether the current block is valid or not.The
next
function checks thedeleteBelowTs
to ensure that we don't end up reading deleted data from the disk, however, thevalid
function did not earlier include that check. As a result, we would end up reading one deleted UID from each part in the split posting list, after which we would callnext
, which would discard the rest of the part. This PR adds the samedeleteBelowTs
check to thevalid
function as well, to ensure that this does not happen.This change is