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
server/node: allow restart with a StoreIdent when cluster not boostrappped #4334
Conversation
…ppped Signed-off-by: Neil Shen <overvenus@gmail.com>
Signed-off-by: Neil Shen <overvenus@gmail.com>
Signed-off-by: Neil Shen <overvenus@gmail.com>
Signed-off-by: Neil Shen <overvenus@gmail.com>
89613ac
to
5836b08
Compare
Signed-off-by: Neil Shen <overvenus@gmail.com>
This comment has been minimized.
This comment has been minimized.
5836b08
to
b31192a
Compare
This comment has been minimized.
This comment has been minimized.
/run-integration-common-test |
Signed-off-by: Neil Shen <overvenus@gmail.com>
src/raftstore/store/bootstrap.rs
Outdated
@@ -155,10 +146,18 @@ mod tests { | |||
); | |||
let engines = Engines::new(Arc::clone(&kv_engine), Arc::clone(&raft_engine)); | |||
|
|||
let mut region = metapb::Region::new(); |
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.
You can use initial_region
here too.
src/server/node.rs
Outdated
.get_msg::<metapb::Region>(keys::PREPARE_BOOTSTRAP_KEY)?; | ||
if res.is_none() { | ||
return Ok(()); | ||
.get_msg::<metapb::Region>(keys::PREPARE_BOOTSTRAP_KEY)? |
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.
Is the type hint really necessary?
.unwrap(); | ||
let store_id = ident.get_store_id(); | ||
let sim = Arc::new(RwLock::new(NodeCluster::new(Arc::clone(&pd_client)))); | ||
let mut cluster = Cluster::new(0, 5, sim, pd_client); |
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.
Why create a new cluster?
node.stop(); | ||
fail::remove(fp); | ||
|
||
let (_, system) = fsm::create_raft_batch_system(&cfg.raft_store); |
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.
Why not add a try_start
function to cluster? So that you don't have to repeat the code here.
Signed-off-by: Neil Shen <overvenus@gmail.com>
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.
LGTM
Signed-off-by: Neil Shen <overvenus@gmail.com>
Signed-off-by: Neil Shen <overvenus@gmail.com>
Signed-off-by: Neil Shen <overvenus@gmail.com>
2bf1529
to
2338765
Compare
Signed-off-by: Neil Shen <overvenus@gmail.com>
/run-all-tests |
…ppped (tikv#4334) Signed-off-by: Neil Shen <overvenus@gmail.com>
What have you changed? (mandatory)
Allow restart TiKV with a StoreIdent when the cluster is not bootstrapped.
What are the type of the changes? (mandatory)
How has this PR been tested? (mandatory)
Integration test.
Does this PR affect documentation (docs) update? (mandatory)
No.
Does this PR affect tidb-ansible update? (mandatory)
No.
Refer to a related PR or issue link (optional)
Close #4333