-
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
Move shard API #869
Move shard API #869
Conversation
07d04fd
to
09f41d3
Compare
schema: | ||
$ref: "#/components/schemas/ClusterOperations" | ||
parameters: |
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.
it also requires definition for {collection_name}
in path
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.
good catch 👍
c05f7a7
Will the user then select if he wants automatic or manual shard movement mode? |
09f41d3
to
cec2ecc
Compare
@e-ivkov I do not think we have a clear vision regarding manual vs automatic shard movement mode. In the absence of automatic shard re-balancing, this endpoint enables us to test the transfer feature at various scales or to perform admin tasks manually. |
I have added a basic report of ongoing shard transfers in the collection cluster info API (#866) I just wanted to validate that it works properly {
"peer_id": 13493294820967747131,
"shard_count": 2,
"local_shards": [
{
"shard_id": 0,
"points_count": 4
}
],
"remote_shards": [
{
"shard_id": 1,
"peer_id": 15343882160508435617
}
],
"shard_transfers": [
{
"shard_id": 0,
"to": 15343882160508435617
}
]
} |
@@ -423,7 +427,7 @@ impl Collection { | |||
existing_temporary_shard.before_drop().await; | |||
|
|||
match existing_temporary_shard { | |||
Local(local_shard) => { | |||
Shard::Local(local_shard) => { |
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 was the only spot using the import
if dispatcher.consensus_state().is_none() { | ||
return Err(StorageError::BadRequest { | ||
description: "Distributed mode disabled".to_string(), | ||
}); | ||
} | ||
let consensus_state = dispatcher.consensus_state().unwrap(); |
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 probably looks cleaner and no unwraps there 😄
let consensus_state = dispatcher.consensus_state() {
Some(state) => state,
None => return Err(..),
}
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.
Thanks, it does look better.
I will remember this trick 👍
This PR adds a new API to trigger the shard transfers explicitly. (#861)
It contains a new consensus test showing that the transfer works in practice.