@@ -504,57 +504,6 @@ pub trait ShardTransferConsensus: Send + Sync {
504504 from_state : Option < ReplicaState > ,
505505 ) -> CollectionResult < ( ) > ;
506506
507- /// Propose to set the shard replica state on this peer through consensus
508- ///
509- /// This internally confirms and retries a few times if needed to ensure consensus picks up the
510- /// operation.
511- async fn set_shard_replica_set_state_confirm_and_retry (
512- & self ,
513- peer_id : Option < PeerId > ,
514- collection_id : & CollectionId ,
515- shard_id : ShardId ,
516- state : ReplicaState ,
517- from_state : Option < ReplicaState > ,
518- ) -> CollectionResult < ( ) > {
519- let mut result = Err ( CollectionError :: service_error (
520- "`set_shard_replica_set_state_confirm_and_retry` exit without attempting any work, \
521- this is a programming error",
522- ) ) ;
523-
524- for attempt in 0 ..CONSENSUS_CONFIRM_RETRIES {
525- if attempt > 0 {
526- sleep ( CONSENSUS_CONFIRM_RETRY_DELAY ) . await ;
527- }
528-
529- log:: trace!( "Propose and confirm set shard replica set state" ) ;
530- result = self
531- . set_shard_replica_set_state (
532- peer_id,
533- collection_id. clone ( ) ,
534- shard_id,
535- state,
536- from_state,
537- )
538- . await ;
539-
540- match & result {
541- Ok ( ( ) ) => break ,
542- Err ( err) => {
543- log:: error!(
544- "Failed to confirm set shard replica set state operation on consensus: {err}"
545- ) ;
546- }
547- }
548- }
549-
550- result. map_err ( |err| {
551- CollectionError :: service_error ( format ! (
552- "Failed to set shard replica set state through consensus \
553- after {CONSENSUS_CONFIRM_RETRIES} retries: {err}"
554- ) )
555- } )
556- }
557-
558507 /// Propose to commit the read hash ring.
559508 ///
560509 /// # Warning
0 commit comments