Skip to content

Commit

Permalink
address review issues
Browse files Browse the repository at this point in the history
  • Loading branch information
SzyWilliam committed Jan 3, 2025
1 parent 9b652a4 commit 114c863
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions ratis-docs/src/site/markdown/configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ peer and the leader's latest committed index is less than this gap, we
treat the peer as caught-up. Increase this number when write throughput is high.

---------------------------------------------------------------------------------
| **Property** | `raft.server.bootstrap.timeout` |
|:----------------|:------------------------------------|
| **Description** | timeout of bootstrapping a new peer |
| **Type** | TimeDuration |
| **Default** | 3 times of timeoutMax |
| **Property** | `raft.server.staging.timeout` |
|:----------------|:-----------------------------------------|
| **Description** | timeout of bootstrapping a new peer |
| **Type** | TimeDuration |
| **Default** | 3 times of `raft.server.rpc.timeout.max` |

During the initialization of a new peer, the leader will classify the bootstrap process as "NO PROGRESS"
if it fails to receive any RPC responses from this peer within this specified timeout period.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,18 +116,18 @@ static void setStagingCatchupGap(RaftProperties properties, int stagingCatchupGa
setInt(properties::setInt, STAGING_CATCHUP_GAP_KEY, stagingCatchupGap);
}

String BOOTSTRAP_TIMEOUT_KEY = PREFIX + ".bootstrap.timeout";
String STAGING_TIMEOUT_KEY = PREFIX + ".staging.timeout";

TimeDuration BOOTSTRAP_TIMEOUT_DEFAULT = null;
TimeDuration STAGING_TIMEOUT_DEFAULT = null;

static TimeDuration bootstrapTimeout(RaftProperties properties) {
final TimeDuration fallbackFirstElectionTimeoutMax = Rpc.timeoutMax(properties, null).multiply(3);
return getTimeDuration(properties.getTimeDuration(fallbackFirstElectionTimeoutMax.getUnit()),
BOOTSTRAP_TIMEOUT_KEY, BOOTSTRAP_TIMEOUT_DEFAULT,
Rpc.TIMEOUT_MAX_KEY, fallbackFirstElectionTimeoutMax, getDefaultLog());
static TimeDuration stagingTimeout(RaftProperties properties) {
final TimeDuration fallbackStagingTimeout = Rpc.timeoutMax(properties, null).multiply(3);
return getTimeDuration(properties.getTimeDuration(fallbackStagingTimeout.getUnit()),
STAGING_TIMEOUT_KEY, STAGING_TIMEOUT_DEFAULT,
Rpc.TIMEOUT_MAX_KEY, fallbackStagingTimeout, getDefaultLog());
}
static void setBootstrapTimeout(RaftProperties properties, TimeDuration bootstrapTimeout) {
setTimeDuration(properties::setTimeDuration, BOOTSTRAP_TIMEOUT_KEY, bootstrapTimeout);
static void setStagingTimeout(RaftProperties properties, TimeDuration stagingTimeout) {
setTimeDuration(properties::setTimeDuration, STAGING_TIMEOUT_KEY, stagingTimeout);
}


Expand Down

0 comments on commit 114c863

Please sign in to comment.