Exponential backoff with jitter.
(&self, retry_count: u32)
| 858 | |
| 859 | /// Exponential backoff with jitter. |
| 860 | async fn commit_retry_wait(&self, retry_count: u32) { |
| 861 | let base_wait = self |
| 862 | .commit_min_retry_wait_ms |
| 863 | .saturating_mul(2u64.saturating_pow(retry_count)); |
| 864 | let wait = base_wait.min(self.commit_max_retry_wait_ms); |
| 865 | // Simple jitter: add up to 20% of wait time |
| 866 | let jitter = (wait as f64 * 0.2 * rand_f64()) as u64; |
| 867 | let total_wait = wait + jitter; |
| 868 | tokio::time::sleep(std::time::Duration::from_millis(total_wait)).await; |
| 869 | } |
| 870 | |
| 871 | /// Compute partition stats (min/max/null_counts) across all entries. |
| 872 | fn compute_partition_stats(&self, entries: &[ManifestEntry]) -> Result<BinaryTableStats> { |