BUG 1815 - Do not allow Shards to be created till an appropriate schema context is... 46/11346/4
authorMoiz Raja <moraja@cisco.com>
Thu, 18 Sep 2014 17:54:47 +0000 (10:54 -0700)
committerMoiz Raja <moraja@cisco.com>
Fri, 19 Sep 2014 23:18:57 +0000 (23:18 +0000)
commitf7f22a2284a7ec28c4a35518934e3f9783d503fa
tree7534d20f130f9dab4471a9d3d58a7498465297b2
parent93f1b5b561183147a8a8f91a8af89fd6eb56a0a9
BUG 1815 - Do not allow Shards to be created till an appropriate schema context is available

The fix works like so,
- ShardManager maintains a list of all the modules that it ever knew about
- ShardManager persists the known modules to disk using persistence
- When ShardManager recovers it reads back the knownModules from persistence
- As ShardManager gets new SchemaContext's it checks whether the modules in
  the new SchemaContext are a superset of the knownModules. If they are then
  ShardManager persists it and let's the Shards know about the new SchemaContext
  otherwise the new SchemaContext is rejected and a message is logged

Also reduced the log level of some log messages in RaftActor from info to debug
it was too verbose

Change-Id: If388f690114c58e6a8df30f34ddac32a99f255e5
Signed-off-by: Moiz Raja <moraja@cisco.com>
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActor.java
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/common/actor/AbstractUntypedPersistentActor.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardManager.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardManagerTest.java