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

Add shard transfer method for resharding #4217

Merged
merged 16 commits into from
May 23, 2024
Merged

Conversation

timvisee
Copy link
Member

@timvisee timvisee commented May 10, 2024

Tracked in: #4213

Adds a ReshardingStreamRecords shard transfer method that will be utilized as part of resharding.

Tasks

  • Propagate new hash ring configuration into shard method
  • Only transfer points that fall into the new shard based on the hashring

All Submissions:

  • Contributions should target the dev branch. Did you create your branch from dev?
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Have you formatted your code locally using cargo +nightly fmt --all command prior to submission?
  3. Have you checked your code using cargo clippy --all --all-features command?

@timvisee timvisee marked this pull request as ready for review May 21, 2024 16:30
@timvisee timvisee requested a review from ffuugoo May 21, 2024 16:30
@timvisee
Copy link
Member Author

@ffuugoo I believe all the necessary bits have been implemented. If you think this is sufficient, I'd suggest to merge and polish this further down the line as necessary.

Copy link
Contributor

@ffuugoo ffuugoo left a comment

Choose a reason for hiding this comment

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

LGTM overall, but with a few mostly minor comments.

lib/collection/src/hash_ring.rs Outdated Show resolved Hide resolved
lib/collection/src/shards/transfer/driver.rs Outdated Show resolved Hide resolved
lib/collection/src/shards/transfer/driver.rs Outdated Show resolved Hide resolved
timvisee and others added 2 commits May 22, 2024 15:22
@timvisee timvisee merged commit 8d87880 into dev May 23, 2024
17 checks passed
@timvisee timvisee deleted the resharding-shard-transfer branch May 23, 2024 07:22
generall pushed a commit that referenced this pull request May 26, 2024
* Add stubs for new shard transfer method used in resharding

* Set correct shard replica set state when doing resharding transfer

* Only transfer migrated points on resharding transfer

* Use new resharding type, more convenient moved points check

* Allow to specify different target shard for shard transfers

* Add strict validation to target shard field, only different shard for resharding

* Simplify if-condition

* While doing resharding transfer, take the hashring only once

* Hide resharding transfer method by default

* On resharding transfer validation, the shards must have the same key

* Restructure shard transfer validation logic

* Use correct shard key in resharding transfer

* Update shard transfer validation documentation

* Share transfer batch size constant

* Update lib/collection/src/hash_ring.rs

Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>

* Use correct shard IDs when driving shard transfer

---------

Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants