Skip to content

Commit 1757fe0

Browse files
authored
Merge pull request #120 from stepchowfun/1.0.8
Release v1.0.8
2 parents b306e28 + a51c30d commit 1757fe0

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

Diff for: CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.0.8] - 2023-07-01
9+
10+
### Changed
11+
- RPC retry delays have been reduced, and the sleep between Paxos rounds has been removed entirely.
12+
813
## [1.0.7] - 2023-07-01
914

1015
### Changed

Diff for: Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "paxos"
3-
version = "1.0.7"
3+
version = "1.0.8"
44
authors = ["Stephan Boyer <[email protected]>"]
55
edition = "2021"
66
description = "An implementation of single-decree Paxos."

Diff for: src/proposer.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,10 @@ use {
88
state::{self, ProposalNumber},
99
},
1010
hyper::Client,
11-
rand::{thread_rng, Rng},
12-
std::{io, net::SocketAddr, path::Path, sync::Arc, time::Duration},
13-
tokio::{sync::RwLock, time::sleep},
11+
std::{io, net::SocketAddr, path::Path, sync::Arc},
12+
tokio::sync::RwLock,
1413
};
1514

16-
// Duration constants
17-
const RESTART_DELAY_MIN: Duration = Duration::from_millis(0);
18-
const RESTART_DELAY_MAX: Duration = Duration::from_millis(100);
19-
2015
// Generate a new proposal number.
2116
fn generate_proposal_number(
2217
nodes: &[SocketAddr],
@@ -138,7 +133,6 @@ pub async fn propose(
138133

139134
// The protocol failed. Sleep for a random duration before starting over.
140135
debug!("Failed to reach consensus. Starting over.");
141-
sleep(thread_rng().gen_range(RESTART_DELAY_MIN..RESTART_DELAY_MAX)).await;
142136
}
143137

144138
Ok(())

Diff for: src/rpc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ use {
77
};
88

99
// Duration constants
10-
const EXPONENTIAL_BACKOFF_MIN: Duration = Duration::from_millis(100);
11-
const EXPONENTIAL_BACKOFF_MAX: Duration = Duration::from_secs(2);
10+
const EXPONENTIAL_BACKOFF_MIN: Duration = Duration::from_millis(50);
11+
const EXPONENTIAL_BACKOFF_MAX: Duration = Duration::from_secs(1);
1212
const EXPONENTIAL_BACKOFF_MULTIPLIER: u32 = 2;
1313

1414
// Send a request without retries.

0 commit comments

Comments
 (0)