Upgrade to Atomix 2.0.14
Change-Id: I919aa1337a850f7dc25621d6a990a7d8b4d2ee6f
diff --git a/core/store/primitives/pom.xml b/core/store/primitives/pom.xml
index a0b7473..5f4d799 100644
--- a/core/store/primitives/pom.xml
+++ b/core/store/primitives/pom.xml
@@ -70,7 +70,7 @@
<dependency>
<groupId>io.atomix</groupId>
<artifactId>atomix</artifactId>
- <version>2.0.12</version>
+ <version>2.0.14</version>
</dependency>
<dependency>
diff --git a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/StoragePartitionClient.java b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/StoragePartitionClient.java
index f5f8a99..723dc51 100644
--- a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/StoragePartitionClient.java
+++ b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/StoragePartitionClient.java
@@ -64,13 +64,15 @@
*/
public class StoragePartitionClient implements DistributedPrimitiveCreator, Managed<StoragePartitionClient> {
+ private static final int MAX_RETRIES = 8;
+ private static final String ATOMIC_VALUES_CONSISTENT_MAP_NAME = "onos-atomic-values";
+
private final Logger log = getLogger(getClass());
private final StoragePartition partition;
private final MemberId localMemberId;
private final RaftClientProtocol protocol;
private RaftClient client;
- private static final String ATOMIC_VALUES_CONSISTENT_MAP_NAME = "onos-atomic-values";
private final com.google.common.base.Supplier<AsyncConsistentMap<String, byte[]>> onosAtomicValuesMap =
Suppliers.memoize(() -> newAsyncConsistentMap(ATOMIC_VALUES_CONSISTENT_MAP_NAME,
Serializer.using(KryoNamespaces.BASIC)));
@@ -110,7 +112,7 @@
.withReadConsistency(ReadConsistency.SEQUENTIAL)
.withCommunicationStrategy(CommunicationStrategy.ANY)
.withTimeout(Duration.ofSeconds(30))
- .withMaxRetries(5)
+ .withMaxRetries(MAX_RETRIES)
.build()
.open()
.join());
@@ -135,7 +137,7 @@
.withReadConsistency(ReadConsistency.SEQUENTIAL)
.withCommunicationStrategy(CommunicationStrategy.ANY)
.withTimeout(Duration.ofSeconds(30))
- .withMaxRetries(5)
+ .withMaxRetries(MAX_RETRIES)
.build()
.open()
.join());
@@ -159,7 +161,7 @@
.withReadConsistency(ReadConsistency.SEQUENTIAL)
.withCommunicationStrategy(CommunicationStrategy.ANY)
.withTimeout(Duration.ofSeconds(30))
- .withMaxRetries(5)
+ .withMaxRetries(MAX_RETRIES)
.build()
.open()
.join());
@@ -189,7 +191,7 @@
.withReadConsistency(ReadConsistency.LINEARIZABLE_LEASE)
.withCommunicationStrategy(CommunicationStrategy.LEADER)
.withTimeout(Duration.ofSeconds(30))
- .withMaxRetries(5)
+ .withMaxRetries(MAX_RETRIES)
.build()
.open()
.join());
@@ -211,7 +213,7 @@
.withReadConsistency(ReadConsistency.LINEARIZABLE_LEASE)
.withCommunicationStrategy(CommunicationStrategy.LEADER)
.withTimeout(Duration.ofSeconds(30))
- .withMaxRetries(5)
+ .withMaxRetries(MAX_RETRIES)
.build()
.open()
.join());
@@ -235,7 +237,7 @@
.withReadConsistency(ReadConsistency.LINEARIZABLE_LEASE)
.withCommunicationStrategy(CommunicationStrategy.LEADER)
.withTimeout(Duration.ofSeconds(5))
- .withMaxRetries(5)
+ .withMaxRetries(MAX_RETRIES)
.build()
.open()
.join());
@@ -250,7 +252,7 @@
.withReadConsistency(ReadConsistency.SEQUENTIAL)
.withCommunicationStrategy(CommunicationStrategy.ANY)
.withTimeout(Duration.ofSeconds(30))
- .withMaxRetries(5)
+ .withMaxRetries(MAX_RETRIES)
.build()
.open()
.join());
@@ -266,7 +268,7 @@
.withCommunicationStrategy(CommunicationStrategy.LEADER)
.withMinTimeout(Duration.ofMillis(timeUnit.toMillis(leaderTimeout)))
.withMaxTimeout(Duration.ofSeconds(5))
- .withMaxRetries(5)
+ .withMaxRetries(MAX_RETRIES)
.build()
.open()
.join());
diff --git a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/StoragePartitionServer.java b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/StoragePartitionServer.java
index c9cfe53..1b201cd 100644
--- a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/StoragePartitionServer.java
+++ b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/StoragePartitionServer.java
@@ -49,7 +49,8 @@
private static final int MAX_SEGMENT_SIZE = 1024 * 1024 * 64;
private static final long ELECTION_TIMEOUT_MILLIS = 2500;
- private static final long HEARTBEAT_INTERVAL_MILLIS = 250;
+ private static final int ELECTION_THRESHOLD = 5;
+ private static final long HEARTBEAT_INTERVAL_MILLIS = 500;
private final MemberId localMemberId;
private final StoragePartition partition;
@@ -143,9 +144,11 @@
clusterCommunicator))
.withElectionTimeout(Duration.ofMillis(ELECTION_TIMEOUT_MILLIS))
.withHeartbeatInterval(Duration.ofMillis(HEARTBEAT_INTERVAL_MILLIS))
+ .withElectionThreshold(ELECTION_THRESHOLD)
.withStorage(RaftStorage.newBuilder()
.withPrefix(String.format("partition-%s", partition.getId()))
- .withStorageLevel(StorageLevel.MAPPED)
+ .withStorageLevel(StorageLevel.DISK)
+ .withFlushOnCommit()
.withSerializer(new AtomixSerializerAdapter(Serializer.using(StorageNamespaces.RAFT_STORAGE)))
.withDirectory(partition.getDataFolder())
.withMaxSegmentSize(MAX_SEGMENT_SIZE)
@@ -200,9 +203,11 @@
clusterCommunicator))
.withElectionTimeout(Duration.ofMillis(ELECTION_TIMEOUT_MILLIS))
.withHeartbeatInterval(Duration.ofMillis(HEARTBEAT_INTERVAL_MILLIS))
+ .withElectionThreshold(ELECTION_THRESHOLD)
.withStorage(RaftStorage.newBuilder()
.withPrefix(String.format("partition-%s", partition.getId()))
- .withStorageLevel(StorageLevel.MAPPED)
+ .withStorageLevel(StorageLevel.DISK)
+ .withFlushOnCommit()
.withSerializer(new AtomixSerializerAdapter(Serializer.using(StorageNamespaces.RAFT_STORAGE)))
.withDirectory(partition.getDataFolder())
.withMaxSegmentSize(MAX_SEGMENT_SIZE)
diff --git a/features/features.xml b/features/features.xml
index d3f395e..567eda2 100644
--- a/features/features.xml
+++ b/features/features.xml
@@ -59,7 +59,7 @@
<bundle>mvn:com.typesafe/config/1.2.1</bundle>
<bundle>mvn:com.googlecode.concurrent-trees/concurrent-trees/2.6.0</bundle>
<bundle>mvn:commons-io/commons-io/2.4</bundle>
- <bundle>mvn:io.atomix/atomix/2.0.12</bundle>
+ <bundle>mvn:io.atomix/atomix/2.0.14</bundle>
<bundle>mvn:org.glassfish.jersey.core/jersey-client/2.25.1</bundle>
diff --git a/lib/BUCK b/lib/BUCK
index 2c60230..860b5de 100644
--- a/lib/BUCK
+++ b/lib/BUCK
@@ -1,4 +1,4 @@
-# ***** This file was auto-generated at Fri, 5 Jan 2018 21:10:43 GMT. Do not edit this file manually. *****
+# ***** This file was auto-generated at Tue, 23 Jan 2018 20:38:59 GMT. Do not edit this file manually. *****
# ***** Use onos-lib-gen *****
pass_thru_pom(
@@ -207,10 +207,10 @@
remote_jar (
name = 'atomix',
- out = 'atomix-2.0.12.jar',
- url = 'mvn:io.atomix:atomix:jar:2.0.12',
- sha1 = 'f2e814ea90812b843a1ad51b2003dda26267be17',
- maven_coords = 'io.atomix:atomix:2.0.12',
+ out = 'atomix-2.0.14.jar',
+ url = 'mvn:io.atomix:atomix:jar:2.0.14',
+ sha1 = 'b2deb5601c8385c0eaabc952a19241c772f0984c',
+ maven_coords = 'io.atomix:atomix:2.0.14',
visibility = [ 'PUBLIC' ],
)
diff --git a/lib/deps.json b/lib/deps.json
index 544bf8e..0d98ca2 100644
--- a/lib/deps.json
+++ b/lib/deps.json
@@ -116,7 +116,7 @@
"aopalliance-repackaged": "mvn:org.glassfish.hk2.external:aopalliance-repackaged:2.5.0-b32",
"amqp-client": "mvn:com.rabbitmq:amqp-client:jar:3.6.1",
"asm": "mvn:org.ow2.asm:asm:5.0.4",
- "atomix": "mvn:io.atomix:atomix:2.0.12",
+ "atomix": "mvn:io.atomix:atomix:2.0.14",
"commons-codec": "mvn:commons-codec:commons-codec:1.10",
"commons-collections": "mvn:commons-collections:commons-collections:3.2.2",
"commons-configuration": "mvn:commons-configuration:commons-configuration:1.10",