From: Robert Varga Date: Mon, 25 May 2020 17:44:44 +0000 (+0200) Subject: Add documentation about per-shard settings X-Git-Tag: v2.0.1~12 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=7a28e6fd2df73b998b26cd33af7e6a34d6d348e9;hp=4152b84fbf3d8d5436467f96076c6fb6a0f2ae4a Add documentation about per-shard settings Previous implementation of per-shard datastore properties did not document this ability. Make sure we document it and properly test it. JIRA: CONTROLLER-911 Change-Id: I5be13c73e76e612a93620710e6a00b78d9dee216 Signed-off-by: Robert Varga --- diff --git a/opendaylight/md-sal/sal-clustering-config/src/main/resources/initial/datastore.cfg b/opendaylight/md-sal/sal-clustering-config/src/main/resources/initial/datastore.cfg index d43ed4b01b..afceb37f7a 100644 --- a/opendaylight/md-sal/sal-clustering-config/src/main/resources/initial/datastore.cfg +++ b/opendaylight/md-sal/sal-clustering-config/src/main/resources/initial/datastore.cfg @@ -4,6 +4,15 @@ # the "shard-election-timeout-factor" property would be applied to both data stores whereas specifying # "operational.shard-election-timeout-factor" would only apply to the "operational" data store. Similarly, # specifying "config.shard-election-timeout-factor" would only apply to the "config" data store. +# Overall flexibility goes even further, as these overrides can also be combined with per-shard specification, +# so that you can also use: +# . +# .. +# for example: +# topology.shard-election-timeout-factor=2 # override both config/operational for topology shard +# config.topology.shard-election-timeout-factor=5 # override config for topology shard +# operational.topology.shard-election-timeout-factor=7 # override operational for topology shard +# # The multiplication factor to be used to determine shard election timeout. The shard election timeout # is determined by multiplying shardHeartbeatIntervalInMillis with the shardElectionTimeoutFactor. diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DatastoreContextIntrospectorTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DatastoreContextIntrospectorTest.java index 6a684ff32b..2d6e4ebcbc 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DatastoreContextIntrospectorTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DatastoreContextIntrospectorTest.java @@ -217,6 +217,7 @@ public class DatastoreContextIntrospectorTest { properties.put("operational.shard-transaction-idle-timeout-in-minutes", "33"); // operational override properties.put("config.shard-transaction-idle-timeout-in-minutes", "44"); // config override properties.put("topology.shard-transaction-idle-timeout-in-minutes", "55"); // global shard override + properties.put("config.topology.persistent", "false"); // per-shard config override final DatastoreContextIntrospector operIntrospector = INTROSPECTOR_FACTORY.newInstance(OPERATIONAL); @@ -237,6 +238,7 @@ public class DatastoreContextIntrospectorTest { shardContext = configIntrospector.newContextFactory().getShardDatastoreContext("topology"); assertEquals(55, shardContext.getShardTransactionIdleTimeout().toMinutes()); + assertFalse(shardContext.isPersistent()); // operational shard override properties.put("operational.topology.shard-transaction-idle-timeout-in-minutes", "66"); @@ -253,5 +255,6 @@ public class DatastoreContextIntrospectorTest { shardContext = configIntrospector.newContextFactory().getShardDatastoreContext("default"); assertEquals(44, shardContext.getShardTransactionIdleTimeout().toMinutes()); + assertTrue(shardContext.isPersistent()); } }