From d88400b2884a1918d861f91eba99d57761fa23c9 Mon Sep 17 00:00:00 2001 From: Yuta HIGUCHI Date: Tue, 25 Nov 2014 12:13:30 -0800 Subject: [PATCH] DatabaseManager: extended election Timeout 2s -> 5s Change-Id: I192113f634cd27c21b7d987b784bc81b1c6bde44 --- .../org/onlab/onos/store/service/impl/DatabaseManager.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/store/dist/src/main/java/org/onlab/onos/store/service/impl/DatabaseManager.java b/core/store/dist/src/main/java/org/onlab/onos/store/service/impl/DatabaseManager.java index e9fdb48500..b3fdfa84e8 100644 --- a/core/store/dist/src/main/java/org/onlab/onos/store/service/impl/DatabaseManager.java +++ b/core/store/dist/src/main/java/org/onlab/onos/store/service/impl/DatabaseManager.java @@ -117,9 +117,12 @@ public class DatabaseManager implements DatabaseService, DatabaseAdminService { private volatile LeaderElectEvent myLeaderEvent = null; - // TODO make this configuratble + // TODO make this configurable private int maxLogSizeBytes = 128 * (1024 ^ 2); + // TODO make this configurable + private long electionTimeoutMs = 5000; // CopyCat default: 2000 + @Activate public void activate() throws InterruptedException, ExecutionException { @@ -181,6 +184,7 @@ public class DatabaseManager implements DatabaseService, DatabaseAdminService { CopycatConfig ccConfig = new CopycatConfig(); ccConfig.setMaxLogSize(maxLogSizeBytes); + ccConfig.setElectionTimeout(electionTimeoutMs); copycat = new Copycat(stateMachine, consensusLog, cluster, copycatMessagingProtocol, ccConfig); copycat.event(LeaderElectEvent.class).registerHandler(new RaftLeaderElectionMonitor());