pub fn check_needs_retry(&mut self, cfg: &Config) -> bool {
        if self.reads.len() == self.ready_cnt {
            return false;
        }

        if self.retry_countdown == usize::MAX {
            self.retry_countdown = cfg.raft_election_timeout_ticks - 1;
            return false;
        }

        if self.retry_countdown > 0 {
            self.retry_countdown -= 1;
            return false;
        }

        self.retry_countdown = cfg.raft_election_timeout_ticks;
        true
    }
/// Check it's necessary to retry pending read requests or not.
/// Return true if all such conditions are satisfied:
/// 1. more than an election timeout elapsed from the last request push;
/// 2. more than an election timeout elapsed from the last retry;
/// 3. there are still unresolved requests in the queue.
Check it's necessary to retry pending read requests or not.
Return true if all such conditions are satisfied:
1. more than an election timeout elapsed from the last request push;
2. more than an election timeout elapsed from the last retry;
3. there are still unresolved requests in the queue.
Check it ' s necessary to retry pending read requests or not . Return true if all such conditions are satisfied : 1 . more than an election timeout elapsed from the last request push ; 2 . more than an election timeout elapsed from the last retry ; 3 . there are still unresolved requests in the queue .
pub fn check_needs_retry(&mut self, cfg: &Config) -> bool {
        if self.reads.len() == self.ready_cnt {
            return false;
        }
        if self.retry_countdown == usize::MAX {
            self.retry_countdown = cfg.raft_election_timeout_ticks - 1;
            return false;
        }
        if self.retry_countdown > 0 {
            self.retry_countdown -= 1;
            return false;
        }
        self.retry_countdown = cfg.raft_election_timeout_ticks;
        true
    }
pub fn check_needs_retry ( & mut self , cfg : & Config ) -> bool { if self . reads . len ( ) == self . ready_cnt { return false ; } if self . retry_countdown == usize :: MAX { self . retry_countdown = cfg . raft_election_timeout_ticks - 1 ; return false ; } if self . retry_countdown > 0 { self . retry_countdown -= 1 ; return false ; } self . retry_countdown = cfg . raft_election_timeout_ticks ; true }
Check it's necessary to retry pending read requests or not.
Check it ' s necessary to retry pending read requests or not .
&mut self
cfg
&Config