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

Refactor and Optimize data streaming #2442

Merged
merged 10 commits into from
Jun 14, 2018
Merged

Refactor and Optimize data streaming #2442

merged 10 commits into from
Jun 14, 2018

Conversation

manishrjain
Copy link
Contributor

@manishrjain manishrjain commented Jun 13, 2018

There are two kinds of data streaming going on. One is to do a predicate move on instructions from Zero. Other is when a replica server requests for a snapshot. Both were using different code, with very similar logic. So, refactored the two into one common file, stream_lists.go.

Also optimized the streaming, so we generate key ranges first, then have multiple goroutines pick up a range each, and iterate over it, generating one KVS per range. This output is then batched smartly and sent over the wire. This achieves pretty amazing transfer speeds (hard to say, because of the small data sets I'm playing with but, saw it spike to 20 Mbps before the data finishes).

Also fixed a whole bunch of bugs. Some in Badger related to key moves and nil txn.callbacks. And an assert failure in watermark.go.


This change is Reviewable

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.

1 participant