Skip to content
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

changes on read path for supporting per user index with boltdb-shipper #5073

Merged

Conversation

sandeepsukhani
Copy link
Contributor

What this PR does / why we need it:
Follow up for adding support for per user index in boltdb-shipper. This PR only includes changes on the read path.
The first PR was #5026.

Checklist

  • Tests updated

return err
}

downloadedFilesMtx.Lock()
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure you actually need a lock if you use the index instead of appending.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, that should work, but we skip adding names of the files which went missing due to compaction. This change would leave some of the elements, and the caller will have to skip the empty file names, which would not look good.


return nil
}
t.indexSetsMtx.Lock()
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this lock is taken with the sync should we move that to another go routine, or make that index to be remove later ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, didn't get you here. Do you mean removing broken indexSet somewhere else and not at query time?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I think it's fine to set them aside or ask a worker pool to do this. I don't like the lock basically.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The only reason I did this here is that I wanted to detect and recover from it asap. A worker pool would have to check it periodically and until then the read path would have to keep returning an error. If we clear it up sooner then the next read request could try to initialize it again. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure you don't have to do it now let's see how it goes

Copy link
Contributor

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

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

LGTM

@sandeepsukhani sandeepsukhani merged commit 88b5a76 into grafana:main Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants