Skip to content

Initialize posting list in moveToNextPart #6560

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

Merged
merged 1 commit into from
Sep 24, 2020

Conversation

animesh2049
Copy link
Contributor

@animesh2049 animesh2049 commented Sep 23, 2020

If deleteBelowTs is not zero it.uidPosting won't be intialized in pitr.init(). This could cause panic when we are doing pitr.posting(). Our assumption was that piter.valid() would return false in such cases. This assumption might not always be true. If it.uids is empty, we try to move to next valid part of the list. In the function moveToNextPart we are intitializing many components of pIterator but not uidPosting. If it.uids is filled here, piter.valid() would become true and we
would end up into a panic at pitr.posting().


This change is Reviewable

If `deleteBelowTs` is not zero `it.uidPosting` won't be intialized in
`pitr.inti(). This could cause panic when we are doing `pitr.posting()`.
Our assumption was that `piter.valdi()` would return false in such cases.
This assumption might not always be true. If `it.uids` is empty, we try
to move to next valid part of the list. In the function `moveToNextPart`
we are intitializing many components of pIterator but not `uidPosting`.
If `it.uids` is filled here, `piter.valid()` would become true and we
would end up into a panic at `pitr.posting()`
Copy link
Contributor

@martinmr martinmr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: 0 of 1 files reviewed, all discussions resolved (waiting on @manishrjain and @martinmr)

@animesh2049 animesh2049 merged commit 7873f04 into master Sep 24, 2020
@animesh2049 animesh2049 deleted the animesh2049/init-postinglist branch September 24, 2020 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants