controller.git
9 years agoMake LeaderLocalDelegateFactory a bit more useful 27/17227/9
Robert Varga [Fri, 27 Mar 2015 11:35:37 +0000 (12:35 +0100)]
Make LeaderLocalDelegateFactory a bit more useful

It seems that the two isntantiations use functionality which can be
easily abstracted out, simplifying code.

Change-Id: Id5e7cb71055ef14b2139be2ba74e29f9cd10da60
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "CDS: Move DataChangeListener into a support class"
Tom Pantelis [Tue, 31 Mar 2015 17:33:14 +0000 (17:33 +0000)]
Merge "CDS: Move DataChangeListener into a support class"

9 years agoMerge "BUG-2673: make CDS implement DOMDataTreeChangeListener"
Tom Pantelis [Tue, 31 Mar 2015 17:27:52 +0000 (17:27 +0000)]
Merge "BUG-2673: make CDS implement DOMDataTreeChangeListener"

9 years agoCDS: Move DataChangeListener into a support class 26/17226/8
Robert Varga [Fri, 27 Mar 2015 11:10:04 +0000 (12:10 +0100)]
CDS: Move DataChangeListener into a support class

This patch follows up the pattern set by DataTreeChangeListener and
moves the related code out.

Change-Id: Ib945dc308c2264f21c0a7df8152c1f9f8f908a43
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2673: make CDS implement DOMDataTreeChangeListener 90/16690/25
Robert Varga [Tue, 17 Mar 2015 10:18:53 +0000 (11:18 +0100)]
BUG-2673: make CDS implement DOMDataTreeChangeListener

This patch adds the base support for registering
DOMDataTreeChangeListeners. These are delivered only on the local node,
as efficient serialization requires interaction with the cluster
topology and shard leadership handoff. That functionality will be
delivered in a follow-up patch.

It also introduces a bit common infrastructure to be used by
DataChangeListener code, as it performs a very similar function.

Change-Id: Ifb91d08857684fb160fd923bc25c294d2fca4bc3
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Tune NotificationRouter wait strategy"
Tony Tkacik [Tue, 31 Mar 2015 08:01:00 +0000 (08:01 +0000)]
Merge "Tune NotificationRouter wait strategy"

9 years agoMerge "Adjust Tx rate limiter for unused transactions"
Moiz Raja [Mon, 30 Mar 2015 23:13:25 +0000 (23:13 +0000)]
Merge "Adjust Tx rate limiter for unused transactions"

9 years agoMerge "Export BindingNormalizedNodeSerializer via Config Subsystem."
Ed Warnicke [Mon, 30 Mar 2015 17:39:42 +0000 (17:39 +0000)]
Merge "Export BindingNormalizedNodeSerializer via Config Subsystem."

9 years agoMerge changes I34538a22,I520b0d83
Moiz Raja [Mon, 30 Mar 2015 17:13:38 +0000 (17:13 +0000)]
Merge changes I34538a22,I520b0d83

* changes:
  Refactor ElectionTermImpl into separate class
  Refactor DataPersistenceProviders and RaftActor#persistence

9 years agoMerge "Increase unit test coverage in SnapshotManager"
Moiz Raja [Mon, 30 Mar 2015 16:37:41 +0000 (16:37 +0000)]
Merge "Increase unit test coverage in SnapshotManager"

9 years agoExport BindingNormalizedNodeSerializer via Config Subsystem. 54/17354/1
Tony Tkacik [Mon, 30 Mar 2015 14:51:19 +0000 (16:51 +0200)]
Export BindingNormalizedNodeSerializer via Config Subsystem.

Change-Id: I2cabdc89b01739ef2ffdbedeff9b11038e0fa41f
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoIncrease unit test coverage in SnapshotManager 24/17324/2
Tom Pantelis [Sun, 29 Mar 2015 01:35:43 +0000 (21:35 -0400)]
Increase unit test coverage in SnapshotManager

Added more unit test cases to SnapshotManager and added more assertions
to existing tests.

Change-Id: I35446caa38eb25393a592583e8e3218b53b30e6c
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
9 years agoTune NotificationRouter wait strategy 47/17347/1
Robert Varga [Mon, 30 Mar 2015 13:59:54 +0000 (15:59 +0200)]
Tune NotificationRouter wait strategy

CPU traces show we are seeing NotificationRouter spin for more work even
when there are no notifications being generated. Change the strategy so
we end up block the thread after a period of spinning/yielding. The
default spin period is set to 1ms, followed by 30ms of yielding,
followed by a block.

This should provide reasonable throughput on notification-heavy
workloads as well as not waste a lot of CPU when there are no
notifications.

Change-Id: Ia1de5ff2616392609a0868b9b8ba3bce15baa105
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "BUG 2743 - Added support for runtime RPC's to netconf mdsal northbound."
Tony Tkacik [Mon, 30 Mar 2015 08:27:43 +0000 (08:27 +0000)]
Merge "BUG 2743 - Added support for runtime RPC's to netconf mdsal northbound."

9 years agoMerge "Avoid IllegalArgument on missing source"
Tony Tkacik [Mon, 30 Mar 2015 08:27:31 +0000 (08:27 +0000)]
Merge "Avoid IllegalArgument on missing source"

9 years agoMerge "Increase default negotiation timeout for netconf server to 30s"
Tony Tkacik [Mon, 30 Mar 2015 08:25:17 +0000 (08:25 +0000)]
Merge "Increase default negotiation timeout for netconf server to 30s"

9 years agoMerge "Set unable-to-connect(netconf node) if no sources are available"
Tony Tkacik [Mon, 30 Mar 2015 08:22:19 +0000 (08:22 +0000)]
Merge "Set unable-to-connect(netconf node) if no sources are available"

9 years agoMerge "BUG-1567 Expose sources for submodules in netconf"
Tony Tkacik [Mon, 30 Mar 2015 08:20:45 +0000 (08:20 +0000)]
Merge "BUG-1567 Expose sources for submodules in netconf"

9 years agoMerge "BUG-2877: Allow hello message with no namespace"
Tony Tkacik [Mon, 30 Mar 2015 08:19:46 +0000 (08:19 +0000)]
Merge "BUG-2877: Allow hello message with no namespace"

9 years agoAdjust Tx rate limiter for unused transactions 82/17182/4
Tom Pantelis [Wed, 25 Mar 2015 19:25:48 +0000 (15:25 -0400)]
Adjust Tx rate limiter for unused transactions

I have a test that submits an arbitrary number of config transactions
and I noticed it can take an unusually long time depending on the
initial Tx rate limit setting. With the default setting of 100 it was
very slow even though I could see the adjusted limit increasing where
the elapsed time should've been much shorter.

It turns out the config datastore rate limit wasn't issue. When a
front-end Tx is created, a Tx instance is created in each data store.
The operation Tx's were unused but they artificially limited the config
rate since the operational rate wasn't getting updated, ie it stayed at
100.

I made changes to adjust the rate limit for unused Tx's if there have
been no prior "real" Tx's for that data store. In this case, the
percentile metrics will be 0 so I basically adjust to the current rate
from the other data store. I think this makes sense if we have no other
data to go by.

This required some infa changes so the ActorContext could get access to
the metrics timer for the other data store. Mainly, we need a global
MericsRegistry and JmxReporter across both data stores. I reused the
MetricsReporter class for this to get the static instance (with changes to
support multiple MetricsReporters per domain name). I also added
a static method to get all the data store names.

I found it useful to see the current rate limit via JMX so I added a new
DatastoreInfoMXBean to report it.

Change-Id: I09def94e40a1fe57779e76763e48696140f3a125
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
9 years agoMerge "Add dependency on config file to startup archetype"
Tony Tkacik [Fri, 27 Mar 2015 14:48:34 +0000 (14:48 +0000)]
Merge "Add dependency on config file to startup archetype"

9 years agoMerge "BUG 2792 : ThreePhaseCommitCohortProxy should serialize CanCommit"
Tom Pantelis [Fri, 27 Mar 2015 12:56:43 +0000 (12:56 +0000)]
Merge "BUG 2792 : ThreePhaseCommitCohortProxy should serialize CanCommit"

9 years agoMerge "BUG 2773 : Transition Shard to Leader state when it has no peers"
Tom Pantelis [Fri, 27 Mar 2015 12:52:22 +0000 (12:52 +0000)]
Merge "BUG 2773 : Transition Shard to Leader state when it has no peers"

9 years agoAdd dependency on config file to startup archetype 16/17116/2
Ed Warnicke [Wed, 25 Mar 2015 16:02:14 +0000 (12:02 -0400)]
Add dependency on config file to startup archetype

Change-Id: Ie41e8c47826789b53811c6a92279abaec510d3b9
Signed-off-by: Ed Warnicke <eaw@cisco.com>
9 years agoMerge "BUG-2424 Bump mina sshd-core version to 0.14"
Tony Tkacik [Fri, 27 Mar 2015 12:40:28 +0000 (12:40 +0000)]
Merge "BUG-2424 Bump mina sshd-core version to 0.14"

9 years agoMerge "BUG 2584 : Datastore is ready when all local shards have a leader"
Tom Pantelis [Fri, 27 Mar 2015 12:05:08 +0000 (12:05 +0000)]
Merge "BUG 2584 : Datastore is ready when all local shards have a leader"

9 years agoBUG-1567 Expose sources for submodules in netconf 23/17223/1
Maros Marsalek [Fri, 27 Mar 2015 10:24:54 +0000 (11:24 +0100)]
BUG-1567 Expose sources for submodules in netconf

Yang submodules were not exposed by netconf monitoring in netconf server (for
both config and mdsal servers).

Change-Id: I7adfa5ccf20199a8b8310286ef5194af8545b2e8
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoMerge "Make FollowerLogInformationImpl fields non-volatile"
Moiz Raja [Fri, 27 Mar 2015 10:17:33 +0000 (10:17 +0000)]
Merge "Make FollowerLogInformationImpl fields non-volatile"

9 years agoMerge "Remove RaftActor#trimPersistentData method"
Moiz Raja [Fri, 27 Mar 2015 10:15:57 +0000 (10:15 +0000)]
Merge "Remove RaftActor#trimPersistentData method"

9 years agoBUG 2792 : ThreePhaseCommitCohortProxy should serialize CanCommit 39/17139/3
Moiz Raja [Thu, 26 Mar 2015 00:43:36 +0000 (17:43 -0700)]
BUG 2792 : ThreePhaseCommitCohortProxy should serialize CanCommit

Besides the front-end ConcurrentDOMDataBroker the ThreePhaseCommitCohortProxy
also sends CanCommitTransaction to different Shards. This can also cause us
to get into the deadlock situation described in the bug and so we serialize the
can commits.

Change-Id: Iad527ce812f0b285cf41ce29abab30ec0f975aa1
Signed-off-by: Moiz Raja <moraja@cisco.com>
9 years agoBUG 2584 : Datastore is ready when all local shards have a leader 40/17140/3
Moiz Raja [Thu, 26 Mar 2015 01:32:48 +0000 (18:32 -0700)]
BUG 2584 : Datastore is ready when all local shards have a leader

Earlier we were pre-maturely marking the datastore ready even when
the localshards simply transitioned to the follower state.

Change-Id: I41337497c762384317386ba9feebc192671bf65c
Signed-off-by: Moiz Raja <moraja@cisco.com>
9 years agoRefactor ElectionTermImpl into separate class 09/17209/6
Tom Pantelis [Thu, 26 Mar 2015 04:07:18 +0000 (00:07 -0400)]
Refactor ElectionTermImpl into separate class

To reduce the size of tye RaftActor class for improved readability.

Change-Id: I34538a227ac36355a1a0fcc06bb7167d1b19cf61
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
9 years agoBUG-2877: Allow hello message with no namespace 26/16926/3
Maros Marsalek [Tue, 24 Mar 2015 09:38:41 +0000 (10:38 +0100)]
BUG-2877: Allow hello message with no namespace

Several network equipments (such as Cisco routers) do not set the namespace
attribute (xmlns) in their NETCONF messages. Whether this is valid or not is
unclear according to RFC 6241 (NETCONF). This patch improves interoperability
by relaxing the constraint for a namespace in NETCONF hello messages.

Change-Id: Ie3de4fe454adf0d7dfd3d11eaacacf5d03736502
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoRefactor DataPersistenceProviders and RaftActor#persistence 06/17206/6
Tom Pantelis [Thu, 26 Mar 2015 02:22:45 +0000 (22:22 -0400)]
Refactor DataPersistenceProviders and RaftActor#persistence

Refactored protected DataPersistenceProvider inner class impls to new
files for reuse in unit tests and to reduce inner code.

Also modified RaftActor so the DataPersistenceProvider is set rather
than having derived classes provide via the persistence() abstract method.
This makes it a little easier for derived RaftActors in that they don't
have to maintain a field and easier for unit tests to change the
DataPersistenceProvider impl.

Added a DelegatingPersistentDataProvider that holds the actual impl for
RaftActor. This allows the DataPersistenceProvider to be passed to
internal helper classes without having to update them if the underlyting
impl is changed.

These changes will facilitate further refactoring of code in RaftActor
into separate classes to simplify it.

Change-Id: I520b0d83635356f195e6bff33e44ac8f49e793cf
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
9 years agoMerge "Bug 2194: Find primary shard on remote ShardManager"
Moiz Raja [Thu, 26 Mar 2015 01:21:22 +0000 (01:21 +0000)]
Merge "Bug 2194: Find primary shard on remote ShardManager"

9 years agoRemove RaftActor#trimPersistentData method 03/17203/1
Tom Pantelis [Thu, 26 Mar 2015 00:40:14 +0000 (20:40 -0400)]
Remove RaftActor#trimPersistentData method

The recent snapshot refactoring moved the code in trimPersistentData to
the SnapsotManager and it's no longer called so should be removed.

Change-Id: Ieb7c3b5595f562b8debf62b2ea5b16e656e5fea4
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
9 years agoMerge "Use SnapshotManager"
Tom Pantelis [Thu, 26 Mar 2015 19:23:55 +0000 (19:23 +0000)]
Merge "Use SnapshotManager"

9 years agoMerge "Refactor snapshot code"
Tom Pantelis [Thu, 26 Mar 2015 19:22:37 +0000 (19:22 +0000)]
Merge "Refactor snapshot code"

9 years agoMerge "BUG 2792 : Serialize phase processing in ConcurrentDOMDatBroker"
Tom Pantelis [Thu, 26 Mar 2015 19:12:20 +0000 (19:12 +0000)]
Merge "BUG 2792 : Serialize phase processing in ConcurrentDOMDatBroker"

9 years agoBUG 2773 : Transition Shard to Leader state when it has no peers 09/16909/4
Moiz Raja [Fri, 20 Mar 2015 05:21:09 +0000 (22:21 -0700)]
BUG 2773 : Transition Shard to Leader state when it has no peers

This patch attempts to still take a Shard through it's normal state transitions
so that we still get the term incrementing and other stuff which is specific
to Raft to happen.

Change-Id: Ic786b5440a258eda7ec311300bffeac2ab49e6c2
Signed-off-by: Moiz Raja <moraja@cisco.com>
9 years agoBug 2847: Recovery of a large journal runs out of memory 40/16540/6
Tom Pantelis [Fri, 13 Mar 2015 23:57:47 +0000 (19:57 -0400)]
Bug 2847: Recovery of a large journal runs out of memory

Changed the ShardRecoveryCoordinator to commit each log entries batch
immediately instead of using an executor to prepare write transaction in
parallel and then commit them all on recovery complete. This resulted in
a lot of memory overhead for little to no gain. I also changed it to
cache the serialized ModificationPayload instances instead of
immediately de-serializing - this further reduces the memory footprint
as the serialized instances are much smaller

As a result, all of the recovery code is now in the
ShardRecoveryCoordinator - Shard is essentially a pass through.

I also reduced the shardJournalRecoveryLogBatchSize to 1000 to further
reduce the memory footprint.

Change-Id: I3aaabe52781bc0db14975e0a292ef9fd18aa3d7c
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
9 years agoBUG 2792 : Serialize phase processing in ConcurrentDOMDatBroker 36/17136/1
Moiz Raja [Wed, 25 Mar 2015 22:44:34 +0000 (15:44 -0700)]
BUG 2792 : Serialize phase processing in ConcurrentDOMDatBroker

Ensure that any given submit phase is completed for a cohort before
proceeding to run the same submit phase on the next cohort in the
transaction.

For example if a transaction has 2 cohorts then canCommit on cohort1
must complete before we proceed to canCommit on cohort2.

If we try to concurrently try to process the phase on all cohorts in
a transaction it can lead to deadlocks as outlined in the bug

Change-Id: I4e758770c711d92920a456e2ac3757ebbb63eb46
Signed-off-by: Moiz Raja <moraja@cisco.com>
9 years agoMake FollowerLogInformationImpl fields non-volatile 21/17121/3
Tom Pantelis [Fri, 13 Mar 2015 05:30:32 +0000 (01:30 -0400)]
Make FollowerLogInformationImpl fields non-volatile

The FollowerLogInformationImpl fields nextIndex and matchIndex don't
need to be volatile as they're only accessed via the RaftActor and
akka's happens-before rule guarantees actor state visibility when a
subsequent message is processed.

Change-Id: Ibee0cc8d04c0d65b2f512e44398474439363a00e
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
9 years agoMerge "Do not use ActorSystem.actorFor as it is deprecated"
Tom Pantelis [Wed, 25 Mar 2015 18:43:11 +0000 (18:43 +0000)]
Merge "Do not use ActorSystem.actorFor as it is deprecated"

9 years agoUse SnapshotManager 11/15611/8
Moiz Raja [Tue, 3 Mar 2015 18:11:41 +0000 (10:11 -0800)]
Use SnapshotManager

Change-Id: I0d5d5aee12afb2b1f89fb7e4113c4fa5cc334dd3
Signed-off-by: Moiz Raja <moraja@cisco.com>
9 years agoRefactor snapshot code 10/15610/10
Moiz Raja [Sun, 22 Feb 2015 20:45:25 +0000 (12:45 -0800)]
Refactor snapshot code

Snapshot manipulation code and logic is now spread across multiple classes
and is becoming difficult to maintain and understand. This is an attempt to
simplify the implementation and make it easy to move forward.

Change-Id: I34e61c9d4bb4663d5f87d6c11fb6ed75c1bb33f2
Signed-off-by: Moiz Raja <moraja@cisco.com>
9 years agoMerge "Bug-2842:If an install snapshot is in progress, Follower should return immedia...
Tom Pantelis [Wed, 25 Mar 2015 17:18:50 +0000 (17:18 +0000)]
Merge "Bug-2842:If an install snapshot is in progress, Follower should return immediately on appendentries"

9 years agoMerge "Remove redundant features: odl-adsal-controller-northbound and odl-nsf-control...
Ed Warnicke [Wed, 25 Mar 2015 17:04:39 +0000 (17:04 +0000)]
Merge "Remove redundant features: odl-adsal-controller-northbound and odl-nsf-controller-managers"

9 years agoMerge "BUG 2852 : Reduce and improve logging in RemoteRpcImplementation"
Tom Pantelis [Wed, 25 Mar 2015 17:01:51 +0000 (17:01 +0000)]
Merge "BUG 2852 : Reduce and improve logging in RemoteRpcImplementation"

9 years agoMerge "Bug 2194: Modify FindPrimary to check for leader"
Moiz Raja [Wed, 25 Mar 2015 16:15:58 +0000 (16:15 +0000)]
Merge "Bug 2194: Modify FindPrimary to check for leader"

9 years agoMerge "Add LeaderStateChanged notification"
Moiz Raja [Wed, 25 Mar 2015 16:15:32 +0000 (16:15 +0000)]
Merge "Add LeaderStateChanged notification"

9 years agoBUG-2424 Bump mina sshd-core version to 0.14 93/17093/2
Maros Marsalek [Wed, 25 Mar 2015 10:10:19 +0000 (11:10 +0100)]
BUG-2424 Bump mina sshd-core version to 0.14

The 0.14 version includes fix for following issue:
https://issues.apache.org/jira/browse/SSHD-393

It caused the transfer over ssh to freeze completely when sending big messages
e.g. 8Mb

Tested using connection between ODL and netconf-testtool transfering yang schema
with size of 40Mb.

Change-Id: I8a2dc38f0feed30a0f6b6c4197e9a546df16491b
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoRemove redundant features: odl-adsal-controller-northbound and odl-nsf-controller... 07/17107/2
Flavio Fernandes [Wed, 25 Mar 2015 12:58:03 +0000 (08:58 -0400)]
Remove redundant features: odl-adsal-controller-northbound and odl-nsf-controller-managers

With changes introduced by [1], the two features mentioned above are equivalent to their
conterparts: odl-adsal-northbound and odl-nsf-managers. This change eliminates the redundant
features, which were introduced in [2].

Patch 2: typo (redundant)

[1]: https://git.opendaylight.org/gerrit/#/c/15749/
[2]: https://git.opendaylight.org/gerrit/#/c/15566/

Change-Id: Ia3c955603a165e5c00f9f623e18901352efe2ba4
Signed-off-by: Flavio Fernandes <ffernand@redhat.com>
9 years agoSet unable-to-connect(netconf node) if no sources are available 03/17103/1
Maros Marsalek [Wed, 25 Mar 2015 12:09:11 +0000 (13:09 +0100)]
Set unable-to-connect(netconf node) if no sources are available

Currently the state was set to connecting even though the connection attempts
stopped.

Change-Id: I9c5eaa1c7a547c2efaa7224d1c75f1c0c7dad5cc
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoMerge "BUG 2799: Migration of Message Bus from deprecated Helium MD-SAL APIs to Lithi...
Tony Tkacik [Wed, 25 Mar 2015 09:18:32 +0000 (09:18 +0000)]
Merge "BUG 2799: Migration of Message Bus from deprecated Helium MD-SAL APIs to Lithium API"

9 years agoIncrease default negotiation timeout for netconf server to 30s 53/17053/4
Maros Marsalek [Tue, 24 Mar 2015 12:33:54 +0000 (13:33 +0100)]
Increase default negotiation timeout for netconf server to 30s

5s is a bit too short. especially when testing.

Change-Id: I47a1ccedab596c78e9d1ba314679d0b542722889
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoBUG 2743 - Added support for runtime RPC's to netconf mdsal northbound. 71/16071/9
Tomas Cere [Mon, 2 Mar 2015 09:50:47 +0000 (10:50 +0100)]
BUG 2743 - Added support for runtime RPC's to netconf mdsal northbound.

Change-Id: I7f978502926c47535efc074a0522f6cfc0a3c3a5
Signed-off-by: Tomas Cere <tcere@cisco.com>
9 years agoBug 2194: Find primary shard on remote ShardManager 94/16194/12
Tom Pantelis [Wed, 25 Mar 2015 04:07:39 +0000 (00:07 -0400)]
Bug 2194: Find primary shard on remote ShardManager

If there is no local shard, the ShardManager now forwards the FindPrimary
message to another ShardManager member.

I changed the FindPrimary and PrimaryFound messages to Serializable.
Previously they implemented SerializableMessage but they didn't have
equivalent protobuff messages so they couldn't be sent over the wire.
These are simple messages and we don't need protobuff.

I also obsoleted the ActorNotInitialized and PrimaryNotFound messages as
we also have equivalent exception classes (which are inhently
Serializable) so the former messages are redundant. This avoids
translation in ActorContext#findPrimaryShardAsync.

Change-Id: I5762ec1dafb9aa12ee8230efe245b154b0bb9b72
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
9 years agoBUG 2852 : Reduce and improve logging in RemoteRpcImplementation 25/16725/3
Moiz Raja [Fri, 13 Mar 2015 01:56:51 +0000 (18:56 -0700)]
BUG 2852 : Reduce and improve logging in RemoteRpcImplementation

- Log an invoke rpc error only at warn level by default
- At debug level log the failure stack trace
- Include more context like rpc name and identifier in the log message

Change-Id: I00d3a52418acd07232ed0f4cc93b8de55d03d144
Signed-off-by: Moiz Raja <moraja@cisco.com>
9 years agoBug-2842:If an install snapshot is in progress, Follower should return immediately... 16/16616/3
Kamal Rameshan [Mon, 16 Mar 2015 05:54:40 +0000 (22:54 -0700)]
Bug-2842:If an install snapshot is in progress, Follower should return immediately on appendentries

Change-Id: I6593bbd1661880bedc17f3850488a022f8c7ed80
Signed-off-by: Kamal Rameshan <kramesha@cisco.com>
Signed-off-by: Moiz Raja <moraja@cisco.com>
9 years agoBug 2194: Modify FindPrimary to check for leader 64/16164/18
Tom Pantelis [Tue, 24 Mar 2015 18:46:21 +0000 (14:46 -0400)]
Bug 2194: Modify FindPrimary to check for leader

Write-only transaactions now bypass sending the CreateTransaction
message to the shard however we still need to check if the shard has
a leader.

So I modified the ShardManager to check for this on FindPrimaryShard
message utilizing the RoleChanged and LeaderStateChanged events recently
added. On FindPrimaryShard, if the shard is not ready, ie its role is
Candidate or it has no leaderId or is not initialized, the sender is
recorded and a timeout schedule is started. If the shard becomes ready,
the success message is sent to the sender. If the timer expires, an error
message is sent to the sender, either ActorNotInitilized or
NoShardLeaderException.

I also changed the ShardInformation peerAddresses map to String key
instead of ShardIdentifier for convenient lookup of the leaderId to
obviate the need to parse a ShardIdentifier from a String. The key is
not used/needed as a ShardIdentifier and the Shard converts the keys to
Strings anyway so it made sense to define the key as String. Several
unit tests had to be changed as a result of this.

In ActorContext#findPrimaryShardAsync, I added a check for
NoShardLeaderException.  I also removed the synchronous findPrimaryShard
and findPrimaryShardOrNull methods to avoid having to duplicate the
exception handling. ActorContext#broadcast was the only caller and it
should use findPrimaryShardAsync anyway.

Change-Id: I22bc661314b25812024b7d274afb390768408b0b
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
9 years agoAdd LeaderStateChanged notification 28/16328/5
Tom Pantelis [Tue, 24 Mar 2015 17:55:27 +0000 (13:55 -0400)]
Add LeaderStateChanged notification

For upcoming work, the ShardManager will need to know a shard's
leaderId and, eventually, version. In the RaftActor, when the
behavior's leaderId changes, it now sends a LeaderStateChanged message
to the RoleChangedNotifier actor. The ShardManager will listen for
LeaderStateChanged messages (in another patch).

Change-Id: I53e2d7cae8fd19f96650546af395f82189a09fd8
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
9 years agoOptimize TransactionProxy for write-only transactions 60/16160/8
Tom Pantelis [Sat, 7 Mar 2015 04:40:15 +0000 (23:40 -0500)]
Optimize TransactionProxy for write-only transactions

For write-only transactions, modified TransactionProxy to prepare
the Tx modifications directly on the Shard rather than having the
Shard create a separate ShardTransaction actor. The BatchedModifications
messages are sent directly to the shard. On ready, the last
BatchedModifications is flagged as ready, thus also eliminating the
ReadyTransaction message. In this manner, we eliminate the
CreateTransaction and the ReadyTransaction messages and the
the ShardTransaction actor.

Several new fields were added to the BatchedModifications message:
transactionID, transactionChainID, and ready. On the last, readied
BatchedModifications message, the Shard returns the
BatchedModificationsReply message with the cohort actor (the Shard
itself).

The BatchedModifications messages are handled by the
ShardCommitCoordinator. I started creating a separate
ShardTransactionCoordinator but realized I'd have to duplicate some
storage plus the 2 coordinators should have to interface. The
CohortEntry is used to store the prepared DOMStoreWriteTransaction.
Perhaps ShardCommitCoordinator should be renamed to
ShardTransactionCoordinator but that can be refactored later.

I create a DOMTransactionFactory that is used by both the
ShardCommitCoordinator and the Shard to create DOM transactions and
update the mbean stats.

Change-Id: I0d8126149f80854feb504ed9d8e49bcc7db253ce
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
9 years agoMerge "Add more info to ShardStats JXM bean"
Moiz Raja [Tue, 24 Mar 2015 17:03:46 +0000 (17:03 +0000)]
Merge "Add more info to ShardStats JXM bean"

9 years agoMerge "BUG 2849 : Reduce sending of duplicate replication messages"
Tom Pantelis [Tue, 24 Mar 2015 12:43:46 +0000 (12:43 +0000)]
Merge "BUG 2849 : Reduce sending of duplicate replication messages"

9 years agoMerge "BUG 2854 : Do not add empty read write transactions to the replicable journal"
Tom Pantelis [Tue, 24 Mar 2015 12:39:29 +0000 (12:39 +0000)]
Merge "BUG 2854 : Do not add empty read write transactions to the replicable journal"

9 years agoAvoid IllegalArgument on missing source 99/16999/2
Maros Marsalek [Mon, 23 Mar 2015 13:43:48 +0000 (14:43 +0100)]
Avoid IllegalArgument on missing source

If source was not reported in hello, but was listed in ietf-netconf-monitoring
and it was unable to download it, sal-netconf-connector would fail to build
unavailable-capability from it and fail with IllegalArgumentException.

Look up the QNames for Sources properly.

Change-Id: Ic60135e3ba569fe52e6552f62f846d2aa9c8cc21
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoBUG 2799: Migration of Message Bus from deprecated Helium MD-SAL APIs to Lithium API 76/16976/3
Marian Adamjak [Mon, 23 Mar 2015 09:55:28 +0000 (10:55 +0100)]
BUG 2799: Migration of Message Bus from deprecated Helium MD-SAL APIs to Lithium API

-   remove creation RO transaction instance in try-resouce
    (at notifyExistingNodes method)

Change-Id: Id75c79568b1ad2560aefe27f7a9c567102a7dd05
Signed-off-by: Marian Adamjak <madamjak@cisco.com>
9 years agoDo not use ActorSystem.actorFor as it is deprecated 70/16670/3
Robert Varga [Mon, 16 Mar 2015 23:22:12 +0000 (00:22 +0100)]
Do not use ActorSystem.actorFor as it is deprecated

Stopped using ActorSystem.actorFor and instead replace the
actor path serialization with the right way to serialize an
ActorRef.

Change-Id: I282ec46d88a531eb5ce189a55e25fe6e75413c66
Signed-off-by: Robert Varga <rovarga@cisco.com>
Signed-off-by: Moiz Raja <moraja@cisco.com>
9 years agoAdd more info to ShardStats JXM bean 19/16519/5
Tom Pantelis [Fri, 13 Mar 2015 11:42:02 +0000 (07:42 -0400)]
Add more info to ShardStats JXM bean

Added more raft state information to the ShardStats, including lastIndex,
lastTerm, snapShotIndex, snapshotTerm, replicatedToAllIndex, info about
each follower (if the leader), and peer addresses. Basically all the
pertinent raft actor state is now reported.

Instead of having the Shard update the stats bean as things change,
which would be difficult with some of the state, I changed ShardStats to
send a GetOnDemandRaftState message to the shard actor which returns all
the state info in an OnDemandRaftState reply. This captures the state in
a thread-safe manner. Since each piece of information is returned by the
ShardStats bean in separate methods, I didn't want each call to send the
message so I cache the last OnDemandRaftState reply for 2 seconds.

With this change, the Shard no longer needs to keep the ShardStats up to date
with the current state.

Change-Id: I1775ba35747c68028f5c3e31789b958d35afa172
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
9 years agoMerge "Refactor LeaderElectionScenarioTests"
Moiz Raja [Mon, 23 Mar 2015 17:41:15 +0000 (17:41 +0000)]
Merge "Refactor LeaderElectionScenarioTests"

9 years agoMerge changes Idfb4fbea,Ief82b050
Moiz Raja [Mon, 23 Mar 2015 17:37:32 +0000 (17:37 +0000)]
Merge changes Idfb4fbea,Ief82b050

* changes:
  Add RaftActor integration tests
  Refactor InMemoryJournal and InMemorySnapshot to sal-akka-raft

9 years agoMerge "BUG-2878: Add the XML declaration to every outgoing NETCONF message."
Tony Tkacik [Mon, 23 Mar 2015 11:05:09 +0000 (11:05 +0000)]
Merge "BUG-2878: Add the XML declaration to every outgoing NETCONF message."

9 years agoMerge "BUG-2801: Added filtering for get and getConfig in netconf mdsal northbound."
Tony Tkacik [Mon, 23 Mar 2015 10:06:39 +0000 (10:06 +0000)]
Merge "BUG-2801: Added filtering for get and getConfig in netconf mdsal northbound."

9 years agoMerge "BUG-2837 Check netconf base 1.1 capability correctly"
Tony Tkacik [Mon, 23 Mar 2015 10:05:22 +0000 (10:05 +0000)]
Merge "BUG-2837 Check netconf base 1.1 capability correctly"

9 years agoXSQL: cache ClasLoader reference 52/16952/1
Robert Varga [Sun, 22 Mar 2015 13:50:23 +0000 (14:50 +0100)]
XSQL: cache ClasLoader reference

Instead of looking up the class loader on each invocation, cache it
once. Same goes for the list of interfaces being instantiated.

Change-Id: I3954f65e167c57d090579eeef8924e5cc6fedfed
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoXSQL: prevent autoboxing 51/16951/1
Robert Varga [Sun, 22 Mar 2015 13:44:00 +0000 (14:44 +0100)]
XSQL: prevent autoboxing

Instead of using object instances, which need to be boxed/unboxed, use a
simple field.

Change-Id: I936bea7b62e08053d0c83fbb20cc2ef798b95de6
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoXSQL: eliminate use of System.err.println 50/16950/1
Robert Varga [Sun, 22 Mar 2015 13:47:42 +0000 (14:47 +0100)]
XSQL: eliminate use of System.err.println

Use a normal logger instead.

Change-Id: Ib06dfaf1a0d4c836e1c19353a57cc070fddbf95a
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-2801: Added filtering for get and getConfig in netconf mdsal northbound. 83/16483/7
Tomas Cere [Mon, 9 Mar 2015 15:26:39 +0000 (16:26 +0100)]
BUG-2801: Added filtering for get and getConfig in netconf mdsal northbound.

Change-Id: I37db2b21712c7b3d16c6b9dafa193a3fb9df4430
Signed-off-by: Tomas Cere <tcere@cisco.com>
9 years agoBUG-2837 Check netconf base 1.1 capability correctly 20/16920/1
Maros Marsalek [Fri, 20 Mar 2015 14:19:06 +0000 (15:19 +0100)]
BUG-2837 Check netconf base 1.1 capability correctly

Check the entire URI for netconf base 1.1 presence in hello message

Change-Id: Ida5f9bf3445b24c2945c2ac583f53806f4c1e01f
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoBUG-2878: Add the XML declaration to every outgoing NETCONF message. 19/16919/1
Gwenael Lambrouin [Fri, 20 Mar 2015 14:02:31 +0000 (15:02 +0100)]
BUG-2878: Add the XML declaration to every outgoing NETCONF message.

Cisco routers expect that NETCONF messages are prefixed by the XML declaration
<?xml version="1.0" encoding="UTF-8"?>. Else, they close the NETCONF/SSH
connection and log an error such as "NETCONF-ERROR: parse error before hello seen".

This patch adds the XML declaration to every outgoing NETCONF message so that
Cisco routers accept NETCONF messages coming from the OpenDaylight controller.

This is a workaround for the sake of interoperability: according to RFC 6241,
the XML declaration is optional so Cisco routers should accept NETCONF messages
without XML declaration. See RFC 6241 section 3 "XML Considerations":

   A NETCONF message MAY begin with an XML declaration (see Section 2.8
   of [W3C.REC-xml-20001006]).

Change-Id: I04a8b61a8fcef6738e8a4552f0560aa319add014
Signed-off-by: Gwenael Lambrouin <gwenael.lambrouin@b-com.com>
9 years agoFix settle wait strategy 14/16914/2
Robert Varga [Fri, 20 Mar 2015 12:10:17 +0000 (13:10 +0100)]
Fix settle wait strategy

CountDownLatch time expiration is not reported via exception, so the
reporting code was wrong.

Change-Id: Ic8b0ea7fd50cbcb3d03710ae3949f2447534fe1f
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "BUG-2383: make DOMDataBrokers implement DOMDataTreeChangeService"
Tony Tkacik [Thu, 19 Mar 2015 22:06:47 +0000 (22:06 +0000)]
Merge "BUG-2383: make DOMDataBrokers implement DOMDataTreeChangeService"

9 years agoBUG-2383: make DOMDataBrokers implement DOMDataTreeChangeService 24/16824/6
Robert Varga [Thu, 19 Mar 2015 13:16:48 +0000 (14:16 +0100)]
BUG-2383: make DOMDataBrokers implement DOMDataTreeChangeService

With the datastore support in place, we can now expose the optional
functionality. In order to do so compatibly, we introduce an
experimental API to get access to optional backend features.

Change-Id: I22bf68bd95d98d3c53ee7401442e4812d3615334
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Fix modules Restconf call for mounted devices"
Tony Tkacik [Thu, 19 Mar 2015 21:16:38 +0000 (21:16 +0000)]
Merge "Fix modules Restconf call for mounted devices"

9 years agoMerge "Optimize ResolveDataChangeEventsTask object allocation"
Tony Tkacik [Thu, 19 Mar 2015 21:13:09 +0000 (21:13 +0000)]
Merge "Optimize ResolveDataChangeEventsTask object allocation"

9 years agoMerge "Increase IDLE timeout for ssh netconf server"
Tony Tkacik [Thu, 19 Mar 2015 21:04:28 +0000 (21:04 +0000)]
Merge "Increase IDLE timeout for ssh netconf server"

9 years agoMerge "BUG-2739 Fix concurrent metadata cleanup for netconf-connector"
Tony Tkacik [Thu, 19 Mar 2015 21:04:06 +0000 (21:04 +0000)]
Merge "BUG-2739 Fix concurrent metadata cleanup for netconf-connector"

9 years agoBUG 2412 - Remove CompositeNode from sal-dom-* 30/16630/12
Jan Hajnar [Mon, 16 Mar 2015 11:00:21 +0000 (12:00 +0100)]
BUG 2412 - Remove CompositeNode from sal-dom-*

* removed CompositeNodes from sal-dom-broker
* removed deprecated services from sal-dom-broker
* removed deprecated services from sal-dom-api
* removed deprecated api calls from sal-binding-broker tests and
sal-dom-spi

Change-Id: Iae44e5c0acd0ad602bf98b9961fcd808657ac07b
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
9 years agoBUG-2739 Fix concurrent metadata cleanup for netconf-connector 43/16843/1
Maros Marsalek [Thu, 19 Mar 2015 17:16:49 +0000 (18:16 +0100)]
BUG-2739 Fix concurrent metadata cleanup for netconf-connector

When deleting/closing a netconf-connector, the cleanup came from 2-3 places and
was not properly synchronized resulting in failed transaction with metadata
still present

Change-Id: I91f1c8bf3d5d24cc2cf4fdb02fb1f5cc3f8a8796
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoBUG 2412 - remove CompositeNode from sal-binding-dom-it 73/16773/4
Jan Hajnar [Wed, 18 Mar 2015 14:23:37 +0000 (15:23 +0100)]
BUG 2412 - remove CompositeNode from sal-binding-dom-it

* removed all CompositeNodes from tests which used it. Tests have to be
rewriten with NormalizedNodes ASAP.

Change-Id: Ib666f9fb9de9fc35e1be554cb630ea5f01f6617e
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
9 years agoBUG 2412 - remove CompositeNode from sal-clustering-common 20/16720/5
Jan Hajnar [Wed, 18 Mar 2015 14:25:15 +0000 (15:25 +0100)]
BUG 2412 - remove CompositeNode from sal-clustering-common

* cleaning all help methods from Util classes which are working
with deprecated CompositeNode class

Change-Id: I31397a1379ef541d642acec68542860ac689481e
Signed-off-by: Vaclav Demcak <vdemcak@cisco.com>
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
9 years agoBUG 2412 - remove CompositeNode from sal-remoterpc-connector 54/16754/3
Jan Hajnar [Wed, 18 Mar 2015 16:37:56 +0000 (17:37 +0100)]
BUG 2412 - remove CompositeNode from sal-remoterpc-connector

* akka remote RPC distribution needs move to new DOM API
* remove all tests which are use CompositeNode. Test has to be
rewriten with NormalizedNodes ASAP.

Change-Id: I8863f5c9657992d23be67acb2f542b0fda81db8c
Signed-off-by: Vaclav Demcak <vdemcak@cisco.com>
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
9 years agoBUG 2412 remove CompositeNode from RestconfImpl codeBase 29/16629/8
Jan Hajnar [Wed, 18 Mar 2015 16:27:51 +0000 (17:27 +0100)]
BUG 2412 remove CompositeNode from RestconfImpl codeBase

* remove all references for CompositeNode from Restconf codeBase
* remove all depricated classes from Restconf
* remove all tests which have worked with CompositeNode
 * we would like to fix tests and move to correct place (in yangtools
and controller integration test for JerseyTest suite)

Note: The removed tests are still in git history. A fixes for Test
suite will be realized ASAP (expectation: in next couple of weeks).

Change-Id: I66b423c92e5ff5b34882b92aece54c5f641c070c
Signed-off-by: Vaclav Demcak <vdemcak@cisco.com>
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
9 years agoBug 868: Removed use of CompositeNode Binding Codecs. 35/16835/2
Tony Tkacik [Thu, 19 Mar 2015 14:25:34 +0000 (15:25 +0100)]
Bug 868: Removed use of CompositeNode Binding Codecs.

Change-Id: Iaaf22bd8bc788f26814e06873b483bf0424ceaf2
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "BUG 2799: Migration of Message Bus from deprecated Helium MD-SAL APIs to Lithi...
Tony Tkacik [Thu, 19 Mar 2015 15:54:25 +0000 (15:54 +0000)]
Merge "BUG 2799: Migration of Message Bus from deprecated Helium MD-SAL APIs to Lithium API (copyrights corrected)"

9 years agoMerge "Renamed Binding DOM Adapters to share same naming convention."
Ed Warnicke [Thu, 19 Mar 2015 15:31:32 +0000 (15:31 +0000)]
Merge "Renamed Binding DOM Adapters to share same naming convention."

9 years agoMerge "Bug 868: Binding MD-SAL exports new codec factory."
Ed Warnicke [Thu, 19 Mar 2015 15:02:00 +0000 (15:02 +0000)]
Merge "Bug 868: Binding MD-SAL exports new codec factory."

9 years agoFix modules Restconf call for mounted devices 33/16833/1
Maros Marsalek [Thu, 19 Mar 2015 14:58:39 +0000 (15:58 +0100)]
Fix modules Restconf call for mounted devices

Restconf was relying on the remote devices to contain restconf yang model. Now
Restconf relies on the controller's schema context when it serializes the
modules response.

Change-Id: Ib406d0082a5aafb7e894440ee5f75e5032ea35ba
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoMerge "BUG-2673: deprecate ListenerNode,Tree and Walker"
Tony Tkacik [Thu, 19 Mar 2015 14:34:55 +0000 (14:34 +0000)]
Merge "BUG-2673: deprecate ListenerNode,Tree and Walker"