mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-25 06:11:05 +02:00
DatabaseManager: extended election Timeout 2s -> 5s
Change-Id: I192113f634cd27c21b7d987b784bc81b1c6bde44
This commit is contained in:
parent
e5ab13826c
commit
d88400b288
@ -117,9 +117,12 @@ public class DatabaseManager implements DatabaseService, DatabaseAdminService {
|
|||||||
|
|
||||||
private volatile LeaderElectEvent myLeaderEvent = null;
|
private volatile LeaderElectEvent myLeaderEvent = null;
|
||||||
|
|
||||||
// TODO make this configuratble
|
// TODO make this configurable
|
||||||
private int maxLogSizeBytes = 128 * (1024 ^ 2);
|
private int maxLogSizeBytes = 128 * (1024 ^ 2);
|
||||||
|
|
||||||
|
// TODO make this configurable
|
||||||
|
private long electionTimeoutMs = 5000; // CopyCat default: 2000
|
||||||
|
|
||||||
@Activate
|
@Activate
|
||||||
public void activate() throws InterruptedException, ExecutionException {
|
public void activate() throws InterruptedException, ExecutionException {
|
||||||
|
|
||||||
@ -181,6 +184,7 @@ public class DatabaseManager implements DatabaseService, DatabaseAdminService {
|
|||||||
|
|
||||||
CopycatConfig ccConfig = new CopycatConfig();
|
CopycatConfig ccConfig = new CopycatConfig();
|
||||||
ccConfig.setMaxLogSize(maxLogSizeBytes);
|
ccConfig.setMaxLogSize(maxLogSizeBytes);
|
||||||
|
ccConfig.setElectionTimeout(electionTimeoutMs);
|
||||||
|
|
||||||
copycat = new Copycat(stateMachine, consensusLog, cluster, copycatMessagingProtocol, ccConfig);
|
copycat = new Copycat(stateMachine, consensusLog, cluster, copycatMessagingProtocol, ccConfig);
|
||||||
copycat.event(LeaderElectEvent.class).registerHandler(new RaftLeaderElectionMonitor());
|
copycat.event(LeaderElectEvent.class).registerHandler(new RaftLeaderElectionMonitor());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user