controller.git
8 years agoBug 4823: Add ReachableMember event to Cluster subscription 49/32249/1
Tom Pantelis [Wed, 6 Jan 2016 14:30:06 +0000 (09:30 -0500)]
Bug 4823: Add ReachableMember event to Cluster subscription

The ShardManager wasn't receiving ReachableMember events from the akka
cluster because ClusterWrapperImpl wasn't subscribing for it.

Change-Id: I61f1be23bdffb1d9384fea6610c72d39d5a865aa
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 4823: Notify findPrimary callbacks on ReachableMember event 48/32148/3
Tom Pantelis [Thu, 24 Dec 2015 11:01:43 +0000 (06:01 -0500)]
Bug 4823: Notify findPrimary callbacks on ReachableMember event

Modified the ShardManager to notify waiting findPrimary callbacks when a
ReachableMember event is received and leaderAvailable is set to true.
This prevents waiting findPrimary queries from timng out with
NoShardLeaderException.

Change-Id: Iabcc6f2a66e5271342914ebfcaad23dd1e122787
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
(cherry picked from commit d4d59200f8c56551755c36fbbd2b4aa52defa5cb)

8 years agoBug 4577 Allow specification of a distinct schema cache directory per netconf device 63/30163/13
Ryan Goulding [Wed, 6 Jan 2016 17:09:36 +0000 (12:09 -0500)]
Bug 4577 Allow specification of a distinct schema cache directory per netconf device

A leaf is added to odl-sal-netconf-connector-cfg.yang to allow specification of
a schema cache directory relative to the "cache" directory.  The leaf defaults to
"schema", so the default directory for loaded yang files is "cache/schema".  It
is useful to specify a distinct cache directory per netconf mount to avoid potential
model conflicts.

Change-Id: Ie0c6b653d698c91a443d1b1831306da51bffbf8a
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
8 years agoRemove unused code in NetconfDeviceConnectionManager 18/31918/1
Ryan Goulding [Mon, 28 Dec 2015 18:58:55 +0000 (13:58 -0500)]
Remove unused code in NetconfDeviceConnectionManager

Removes unused private method from NetconfDeviceConnectionManager.java.
This also results in removal of imports of deprecated classes.

Change-Id: Ib8dd533f4573077d4c995d7cae94ea874ce923f2
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
8 years agoBug 4774: Wait for prior RO tx creates on tx chain 17/31817/1
Tom Pantelis [Mon, 14 Dec 2015 23:27:10 +0000 (18:27 -0500)]
Bug 4774: Wait for prior RO tx creates on tx chain

Added a priorReadOnlyTxPromises map to TransactionChainProxy that holds
Promise instances for each read-only tx. When the parent class completes
the primary shard lookup and creates the TransactionContext (either success or
failure), onTransactionContextCreated is called which completes the Promise. A
write tx that is created prior to completion will wait on the Promise's Future via
findPrimaryShard.

Change-Id: Ib1a620cfd5be3e38f633b3faf9ef7a31abaaf345
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
(cherry picked from commit 86a3188d6db1e7da2803a6b36daa2898fe045e45)

8 years agoBug 4774: Add Tx ID to logging on Tx chain failures 32/31632/1
Tom Pantelis [Mon, 14 Dec 2015 19:17:12 +0000 (14:17 -0500)]
Bug 4774: Add Tx ID to logging on Tx chain failures

To help with debugging, it's useful to see the tx ID when a create fails
due to previous tx not ready.

Change-Id: I0547048ea62340a0297affed3512271908eba65a
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
(cherry picked from commit 9681454e5a6acb2ce5e87c72c06e6a03e901c765)

8 years agoAdd missing relatedPath for aggregator's parent 95/31195/2
adetalhouet [Fri, 11 Dec 2015 13:18:45 +0000 (08:18 -0500)]
Add missing relatedPath for aggregator's parent

Change-Id: I04b30fc48c7e105fef96cfd173aef2e405c715e3
Signed-off-by: adetalhouet <adetalhouet@inocybe.com>
8 years agoDo not overwrite operation failure 66/31466/1
Robert Varga [Wed, 16 Dec 2015 15:44:40 +0000 (16:44 +0100)]
Do not overwrite operation failure

When a ready-time failure occurs, do not overwrite it with a null
operation error (if no operations failed).

Change-Id: If2ac379e25af7bc93602b91ea5b068974a196771
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 3f979acfb60c2ffb1ce70c5475bdfce8f8e7df01)

8 years agoBUG-4514: do not retain old internal info 77/31277/2
Robert Varga [Wed, 9 Dec 2015 14:13:35 +0000 (15:13 +0100)]
BUG-4514: do not retain old internal info

Retaining this information past second phase commit leads to it being
retained via dependencyResolver. Thus a series of reconfigurations will
invariably retain the complete history, which is completely wasteful and
constitutes a memory leak (with GC chains of ~1800 hops observed).

Change-Id: Id67b8813a1d55b36f0b55a1c96099b906bf313ad
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-3516: make PingPongTransactionChain.close() asynchronous 57/21557/7
Robert Varga [Mon, 8 Jun 2015 18:18:31 +0000 (20:18 +0200)]
BUG-3516: make PingPongTransactionChain.close() asynchronous

When the system is critical loads Thread.yield can bring a long-term
blocking effect for hijacked threads like Netty. We should not be
blocking for prolonged time.

Rework the shutdown logic to be asynchronous, and scheduling the
potential outstanding transaction to complete as appropriate. Also fixes
the case where we would end up not reporting a transaction failure if
the transaction is readied, but was not submitted to the backend.

Change-Id: Ic7796a980d9e87242f70b7f7b9cdb30caeab9dd9
Signed-off-by: Vaclav Demcak <vdemcak@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-4514: clear destroyed modules 31/31331/1
Robert Varga [Mon, 14 Dec 2015 20:03:11 +0000 (21:03 +0100)]
BUG-4514: clear destroyed modules

When the transaction concludes we do not need to know the destroyed
modules anymore. Clear them out as part of the close sequence.

Change-Id: Ia2a43ed424d96a99cc27df7b685e6abf7393f8a3
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 248f46ddb283452df60d0e084d5a03af82ed5ef5)

8 years agoFix failure of testCloseCandidateRegistrationInQuickSuccession 88/29688/2
Moiz Raja [Fri, 13 Nov 2015 21:32:13 +0000 (13:32 -0800)]
Fix failure of testCloseCandidateRegistrationInQuickSuccession

Moved checking of whether the ownershipchange event occurred with
hasOwner=false to the loop so that we pass the test only when all
listeners receive that event with hasOwner=false

Change-Id: I463272822e6a39f310fef5996b541e1d06c79548
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoBug 4712 - Fix Keepalive task to check the response of a keepalive request 66/30566/7
adetalhouet [Thu, 3 Dec 2015 16:03:49 +0000 (11:03 -0500)]
Bug 4712 - Fix Keepalive task to check the response of a keepalive request

If response is null, tear down the session.

Change-Id: I8ca2302f2f5f0fad09a9ef7ab4511ffb863de343
Signed-off-by: adetalhouet <adetalhouet@inocybe.com>
8 years agoMake karaf-empty a POM package 27/31127/1
Stephen Kitt [Thu, 10 Dec 2015 09:55:56 +0000 (10:55 +0100)]
Make karaf-empty a POM package

opendaylight-karaf-empty is currently a (default) JAR package, which
causes maven-install-plugin to try to install a JAR at all costs. It
ends up copying pom.xml to opendaylight-karaf-empty-....jar which
breaks anything then processing the JARs and expecting them to be
valid (e.g. for signing). Declaring that opendaylight-karaf-empty is a
POM package still produces the Karaf distributions along with the POM,
but avoids generating an invalid JAR.

Change-Id: I766acd4fd12002a05968b286a5290461c409c92e
Signed-off-by: Stephen Kitt <skitt@redhat.com>
8 years agoBUG-4514: clear oldModule/oldInstance when no longer needed 96/30896/2
Robert Varga [Wed, 2 Dec 2015 14:20:22 +0000 (15:20 +0100)]
BUG-4514: clear oldModule/oldInstance when no longer needed

When we acquire a new instance we no longer need the old module nor
instance. Failing to clear these references leads to slow memory leak,
as we retain the complete history of modules as transactions are being
made.

Change-Id: I42899176d335e5f6ac66ecb1dfe080c4dd14ab2a
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 7ff9016372201b5a14fd5b6f2e1faba1bc3760f3)

8 years agoAdd payload along with the log.trace message for REST call 36/30736/2
adetalhouet [Fri, 4 Dec 2015 20:34:10 +0000 (15:34 -0500)]
Add payload along with the log.trace message for REST call

Also add the log.trace for the POST request

Change-Id: I6afce862389d7e61d10359c70387d5726b546915
Signed-off-by: adetalhouet <adetalhouet@inocybe.com>
8 years agoStop failing discard-changes operation when tx wasn't initialized 49/28049/2
Tomas Cere [Thu, 8 Oct 2015 09:58:38 +0000 (11:58 +0200)]
Stop failing discard-changes operation when tx wasn't initialized

Change-Id: Iece3fb47922d441ec863455f9d1981c58190f76e
Signed-off-by: Tomas Cere <tcere@cisco.com>
8 years agoFix get and get-config ordering for netconf-mdsal 46/30146/4
Maros Marsalek [Tue, 24 Nov 2015 15:25:59 +0000 (16:25 +0100)]
Fix get and get-config ordering for netconf-mdsal

Change-Id: Ic31c3d44d89674240d77809041e29a2c7dd50638
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
8 years agoRe-enable tests and bump aaa version 85/30685/2
Thanh Ha [Fri, 4 Dec 2015 02:13:21 +0000 (21:13 -0500)]
Re-enable tests and bump aaa version

This patch is part 2 of 2 patches:

* Increments the version of the depenency on AAA from 0.2.3-Lithium-SR3
* to 0.2.4-SNAPSHOT.
* Re-enables the feature tests for the restconf and netconf-conector
  features.

Change-Id: Iab6934028e2e421166ecbcd9f514b54bfe38c842
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoBumping versions by 0.0.1 for next dev cycle 94/30594/3
Thanh Ha [Thu, 3 Dec 2015 21:40:35 +0000 (16:40 -0500)]
Bumping versions by 0.0.1 for next dev cycle

This patch is part 1 of 2 patches.

* The only version not incrmented is aaa.version, which is left at
  0.2.3-Lithium-SR3 since they depend on controller and can't update yet.
* To break the cyclic dependency, this patch temporarily stops running
  the netconf-connector and restconf feature tests.

A second patch (to be run after AAA increments their versions to
0.2.4-SNAPSHOT) wiil update aaa.version and re-enable these tests.

Change-Id: I9d4a7ac7142444b980b905ec32f63f94634c3bae
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoRelease Lithium-SR3 93/30593/1 release/lithium-sr3
Thanh Ha [Thu, 3 Dec 2015 21:40:30 +0000 (16:40 -0500)]
Release Lithium-SR3

Change-Id: I0aa8308029194959d3a1b5bdec216a40a767d665
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoBUG 4554 : Ownership is not cleared when all candidates are removed 64/29364/6
Moiz Raja [Fri, 6 Nov 2015 02:21:56 +0000 (18:21 -0800)]
BUG 4554 : Ownership is not cleared when all candidates are removed

When all candidates for an entity get unregistered at approximately
the same time it can create a situation where the owner for the
entity is not cleared. Consequently no entity ownership change is
raised where hasOwner is false even when there are no owners for
the entity.

This could be a problem for applications which do
some action when there are no candidates for an entity. The
openflow application for example relies on the disappearance of
all owners to actually remove a switch from inventory. Without
this event we have the situation that nodes hang around in inventory.

Problem Sequence
----------------

The sequence of events which leads to this problem are as follows.

Let's say member-1 owned entity-1 and there are 3 candidates for
entity-1 - member-1, member-2 and member-3. Now let's say due to
some event all candidates have to unregister. The data
transaformations will go like this.

delete member-1
delete member-2
delete member-3
delete member-1 succeeds so choose new owner - in this case member-2
make-owner member-2
delete member-2 succeeds - member-2 is not the current owner so do nothing
delete member-3 succeeds - member-3 is not the current owner so do nothing
make-owner member-2 succeeds. Now we have an owner for entity-1 even though we have not candidates

Solution
--------

The solution proposed in this patch is to set member to empty when
there are no remaining candidates. This changes the above sequence as follows.

delete member-1
delete member-2
delete member-3
delete member-1 succeeds so choose new owner - in this case member-2
make-owner member-2
delete member-2 succeeds - member-2 is not the current owner so do nothing
delete member-3 succeeds - member-3 is the last candidate so set member to ""
make-owner ""
make-owner member-2 succeeds. Now we have an owner for entity-1 even though we have not candidates
make-owner "" succeeds. Now we have owner for entity-1 set to no one as it should be

Change-Id: I583e8c6991742ada5846e87da35db255eeed144e
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoBUG 4589 : Handle writing and reading large strings 76/29476/7
Moiz Raja [Tue, 10 Nov 2015 01:56:32 +0000 (17:56 -0800)]
BUG 4589 : Handle writing and reading large strings

Change-Id: If81926757aef3c1275ba43a7cf8c7adf94d86e08
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoBUG 4615 : Add method on EOS to check if a candidate is registered locally 25/29525/1
Moiz Raja [Wed, 11 Nov 2015 00:05:28 +0000 (16:05 -0800)]
BUG 4615 : Add method on EOS to check if a candidate is registered locally

Change-Id: Iedb2e4cf92553910cf5e1bd85978f88e10bf3c25
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoBug 4563: Increase akka seed-node-timeout 47/29347/1
Tom Pantelis [Fri, 30 Oct 2015 16:56:27 +0000 (12:56 -0400)]
Bug 4563: Increase akka seed-node-timeout

Change-Id: I8f17872ef30a96d58a666e3499cf42ab59f0491d
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
(cherry picked from commit fe73fc4dab6cbdb63aac8db607e88ce1f62a9100)

8 years agoBUG-4521 Support milliseconds in event-time notification format 64/28764/2
Maros Marsalek [Fri, 23 Oct 2015 22:25:40 +0000 (00:25 +0200)]
BUG-4521 Support milliseconds in event-time notification format

Current format does not support milliseconds right now and netconf
notification RFC clearly says the milliseconds should be supported

Change-Id: Ib91b5f08a0ec78721e2b0984b8dc123f3283d2e1
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
8 years agoBug 4560: Improve config system logging for debuggability 85/28985/4
Tom Pantelis [Thu, 29 Oct 2015 19:20:38 +0000 (15:20 -0400)]
Bug 4560: Improve config system logging for debuggability

When a config push fails, most of the exceptions that are thrown are
unchecked (like IllegalArgumentEx) and they aren't explicitly caught
so they propagate to the top-level ConfigPersisterActivator thread and
got printed to syserr. So I added a catch and logged to error.

I also added context to the logged message which outputs the xml file
name to aid in debugging issues.

I also added info logging when a config push starts and when it
successfully completes to further aid in debugging issues.

Change-Id: I3db9dcad3cba0abd58c045bc1047e08d6f19ccd3
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoupdate leveldbjni version to support Solaris 04/28904/2
rshoaib [Sat, 22 Aug 2015 06:24:57 +0000 (23:24 -0700)]
update leveldbjni version to support Solaris

Change-Id: I46de5b3cc9c220a70a408194fb3ff709cdff1937
Signed-off-by: rshoaib <rao.shoaib@oracle.com>
(cherry picked from commit 11c04cc6c57250b575d43aa55402c8a780db1423)

8 years agoFix NPE in EntityOwnerSelectionStrategyConfigReader 05/28905/1
Tom Pantelis [Wed, 28 Oct 2015 19:37:32 +0000 (15:37 -0400)]
Fix NPE in EntityOwnerSelectionStrategyConfigReader

Configuration#getProperties can return null if the config doesn't exist
- need to check for that. Also added more checks and unit tests.

Change-Id: If468fb8c3df7ecba664bb00a8f01bdfec7b4ceeb
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoImplement LeastLoadedCandidateSelectionStrategy 60/28260/7
Moiz Raja [Sun, 11 Oct 2015 20:52:52 +0000 (13:52 -0700)]
Implement LeastLoadedCandidateSelectionStrategy

Change-Id: I09035505bcfa0ef5b2ac357217186ad98db7974c
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoMaintain EntityOwnershipStatistics 59/28259/7
Moiz Raja [Sun, 11 Oct 2015 18:56:25 +0000 (11:56 -0700)]
Maintain EntityOwnershipStatistics

Implementing a LoadBalancing entity owner selection
strategy depends on our ability to find the load on
specific candidates. The EntityOwnershipStatistics collects
this information and provides query methods to access
ownership counts for candidates.

Change-Id: I7e812b15e8fb21e3be1aed10384600b9acb8bf20
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoAdd a mechanism to read the entity owner selection strategies from a config file 57/28257/7
Moiz Raja [Sun, 11 Oct 2015 07:48:34 +0000 (00:48 -0700)]
Add a mechanism to read the entity owner selection strategies from a config file

Change-Id: Ie951e4f83aaf38f00e959f4243820a88cb988788
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoPass in EntityOwnerSelectionStrategyConfig when constructing DistributedEntityOwnersh... 56/28256/5
Moiz Raja [Sun, 11 Oct 2015 01:56:55 +0000 (18:56 -0700)]
Pass in EntityOwnerSelectionStrategyConfig when constructing DistributedEntityOwnershipService

Change-Id: Iad1014db726a06de9a89a9987216ca4c96981122
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoPass in EntityOwnerSelectionStrategyConfig when constructing EntityOwnershipShard 55/28255/4
Moiz Raja [Sun, 11 Oct 2015 01:44:17 +0000 (18:44 -0700)]
Pass in EntityOwnerSelectionStrategyConfig when constructing EntityOwnershipShard

Change-Id: I56c2f4f87c61e81b662cd0b30c60775389e9b9a3
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoAllow passing of delay to the EntityOwnerElectionStrategy 88/28188/7
Moiz Raja [Fri, 9 Oct 2015 01:52:02 +0000 (18:52 -0700)]
Allow passing of delay to the EntityOwnerElectionStrategy

Change-Id: If745443585e68a26c10622a7888ec52dbee0059c
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoAdd Delayed Owner selection base on strategy 87/28187/4
Moiz Raja [Tue, 6 Oct 2015 22:28:27 +0000 (15:28 -0700)]
Add Delayed Owner selection base on strategy

Change-Id: I04fc216ffc7e5c3fd35b34b6d03a5030c359d77f
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoReturn throwable in NeverReconnectStrategy 53/27953/2
Claudio D. Gasparini [Mon, 5 Oct 2015 13:36:00 +0000 (15:36 +0200)]
Return throwable in NeverReconnectStrategy

NeverReconnectStrategy returns empty throwable instead of
passed throwabled with the failed previous
connection reasons.

Change-Id: I5695af09379f06a66c37ccf27293ff85657afeaa
Signed-off-by: Claudio D. Gasparini <cgaspari@cisco.com>
(cherry picked from commit a90b34b052c46e4d405b1c477a3a5a0f47e1bd98)

8 years agoIntroduce EntityOwnerSelectionStrategy 42/27942/4
Moiz Raja [Tue, 6 Oct 2015 02:23:42 +0000 (19:23 -0700)]
Introduce EntityOwnerSelectionStrategy

Currently the EntityOwnershipService does not do any load
balancing, in that it allows the first candidate that registers
to become an owner. There is a need to do that so that applications
which choose to do some *work* based on if it owns an entity can
scale better.

This patch introduces the concept of an EntityOwnerSelectionStrategy
with the intent to provide custom strategies later to choose an owner.

Since custom strategies require intimate knowledge of how the
EntityOwnershipShard chooses a leader at this time I do not think
a strategy can be passed to the EntityOwnershipService via API. The
intent therefor is to choose a strategy based on configuration
wherein a custom strategy can be chosen for each entity type. If
the Strategy needs any custom configuration then it can have configuration
files of it's own

Change-Id: Ia53b8edb59fb1d06a426d9d9a95c07ef4ae65cd1
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoFix DistributedEntityOwnershipIntegrationTest failure 93/28093/1
Tom Pantelis [Tue, 6 Oct 2015 13:43:55 +0000 (09:43 -0400)]
Fix DistributedEntityOwnershipIntegrationTest failure

Fixed intermittent failure due the follower2MockListener getting
an ownershipChanged with "false, false, true" if if the original
ownership change with "member-2 is replicated to follower2 after
the listener is registered. The test ran 100 times successfully.

Change-Id: Ibe282d138b293980a11ea54cf434a00513f294aa
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoRe-enable tests and bump aaa version 92/28092/1
Thanh Ha [Thu, 8 Oct 2015 16:28:30 +0000 (12:28 -0400)]
Re-enable tests and bump aaa version

This patch is part 2 of 2 patches:

* Increments the version of the depenency on AAA from 0.2.2-Lithium-SR2
* to 0.2.3-SNAPSHOT.
* Re-enables the feature tests for the restconf and netconf-conector
  features.

Change-Id: Ia3325503113f177814d126bcdb0a0c5acc54b3e6
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoBumping versions by 0.0.1 after the Lithium SR2 release 91/28091/1
Thanh Ha [Thu, 8 Oct 2015 15:38:02 +0000 (11:38 -0400)]
Bumping versions by 0.0.1 after the Lithium SR2 release

This patch is part 1 of 2 patches.

* The only version not incrmented is aaa.version, which is left at
  0.2.2-Lithium-SR2 since they depend on controller and can't update yet.
* To break the cyclic dependency, this patch temporarily stops running
  the netconf-connector and restconf feature tests.

A second patch (to be run after AAA increments their versions to
0.2.3-SNAPSHOT) wiil update aaa.version and re-enable these tests.

Change-Id: I068eee3ed1207f5b13fd9d01b345413aaf7855b6
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoApplying the Lithium SR2 release patch 90/28090/1 release/lithium-sr2
Thanh Ha [Thu, 8 Oct 2015 15:37:58 +0000 (11:37 -0400)]
Applying the Lithium SR2 release patch

Change-Id: I8c27796aee06b4332ba73ed859e9bb1a395ec2d0
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoRevert "Fix DistributedEntityOwnershipIntegrationTest failure" 89/28089/1
Thanh Ha [Thu, 8 Oct 2015 15:26:37 +0000 (11:26 -0400)]
Revert "Fix DistributedEntityOwnershipIntegrationTest failure"

This reverts commit de587f935016a300cdbeb85926c2eb677f383fc2.

Change-Id: I6d587db51aac176ad0ff0d5078e1c9b7cce802aa
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoFix DistributedEntityOwnershipIntegrationTest failure 17/28017/1
Tom Pantelis [Tue, 6 Oct 2015 13:43:55 +0000 (09:43 -0400)]
Fix DistributedEntityOwnershipIntegrationTest failure

Fixed intermittent failure due the follower2MockListener getting
an ownershipChanged with "false, false, true" if if the original
ownership change with "member-2 is replicated to follower2 after
the listener is registered. The test ran 100 times successfully.

Change-Id: I1f0333e3bc69cc28521bc7388d64b56d18b55544
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoFix NPE in AbstractFeatureWrapper 34/27934/1
Tom Pantelis [Mon, 5 Oct 2015 16:10:23 +0000 (12:10 -0400)]
Fix NPE in AbstractFeatureWrapper

Added check in ChildAwareFeatureWrapper#getChildFeatures to verify the
feature exists in the FeaturesService to avoid NPE. This is a similar
workaround as was done in FeatureConfigPusher for a bug in karaf where
the FeaturesService may mysteriously return null for an existing feature.

Change-Id: I006cd012e919ac206d70bb4ee5754c72f0f01b32
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoAdd getOwnershipState method to EntityOwnershipService 19/27419/1
Tom Pantelis [Fri, 25 Sep 2015 02:05:24 +0000 (22:05 -0400)]
Add getOwnershipState method to EntityOwnershipService

Added a new method to gte the current ownership state for an entity.
This was requested for OF clustering.

The DistributedEntityOwnershipService obtains the EntityOwnershipShard's
DataTree via a new message GetShardDataTree and reads the entity's owner
leaf in order to build the resulting EntityOwnershipState. The DataTree
is obtained once and cached.

Change-Id: Ib4aa2f4e5370d8d5183908b836417936a51458f7
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoFix typo in thrown exception in RestconfImpl.java 16/27316/3
adetalhouet [Tue, 22 Sep 2015 21:25:58 +0000 (17:25 -0400)]
Fix typo in thrown exception in RestconfImpl.java

Change-Id: I81df54043732a5c332d8f8b8209f66c15993cbf1
Signed-off-by: adetalhouet <adetalhouet@inocybe.com>
8 years agoBug 4327 - Fixed DataTreeChangeListener registration in PingPongDataBroker 87/27287/1
Michal Polkorab [Tue, 22 Sep 2015 14:34:06 +0000 (16:34 +0200)]
Bug 4327 - Fixed DataTreeChangeListener registration in PingPongDataBroker

 - delegate broker was incorrectly queried for DOMDataTreeChangeService
 - it must ask for supported extensions instead of instanceof
 - this is lithium branch fix,
   beryllium change: https://git.opendaylight.org/gerrit/#/c/27164/

Change-Id: Ie1757c762018e7188d76a7728f2f8ea52293d73f
Signed-off-by: Michal Polkorab <michal.polkorab@pantheon.sk>
8 years agoBug 4105: Fix intermittent failure in DistributedEntityOwnershipIntegrationTest 26/26926/2
Tom Pantelis [Sat, 12 Sep 2015 00:32:55 +0000 (20:32 -0400)]
Bug 4105: Fix intermittent failure in DistributedEntityOwnershipIntegrationTest

I saw a test filure on jenkins. After follower2 is stopped there will be
2 onOwnershipChange calls so the test needs to expect both.

Change-Id: I74dc583c2d40e966197315640eb189702fbabd64
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 4105: Remove EntityOwnershipCandidate 15/26915/2
Tom Pantelis [Fri, 11 Sep 2015 20:13:24 +0000 (16:13 -0400)]
Bug 4105: Remove EntityOwnershipCandidate

It was decided that we really don't need to pass an
EntityOwnershipCandidate listener when registering a candidate. Since
apps would most likely create a singleton EntityOwnershipCandidate for
all registerCandidate calls, they might as well register the singleton
listener once via registerListener. This simplifies the interface and
also simplifies OF clustering b/c they need an EntityOwnershipListener
anyway for device node cleanup.

Change-Id: I9fb7d68c1ffbf932c9d0e18efef604c1b05fdf96
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 4094: Fix DCNs on initial registration 48/26548/6
Tom Pantelis [Wed, 19 Aug 2015 02:07:52 +0000 (22:07 -0400)]
Bug 4094: Fix DCNs on initial registration

For DataChangeListener, I modified the code to use a
ResolveDataChangeEventsTask to resolve the initial changed event. It
was noted in Bug 4094 to read the registration path up to the first
wildcard. However this did not work. ResolveDataChangeEventsTask
expects the candidate root path and "after" data to be the tree root
to match the structure of the ListenerTree. When a transaction is
committed, the resulting DataTreeCandidate always points to the root.
So I had to read the root path in ShardDataTree. I could've optimized
for non-wildcarded path registrations but I think wildcarded path
registrations will be the norm anyway.

I added a new method, notifyOfInitialData, in ShardDataTree. Because I
had to create a new ListenerTree with the single registration, I
needed to know the path and scope of the original registration so I
changed several method signatures from the general ListenerRegistration
to the specific DataChangeListenerRegistration which provides access to
the path and scope. However we also have an actor class by that name so
to avoid confusion I renamed the actor class to
DataChangeListenerRegistrationActor.

DataTreeChangeListener was implemented similarly.

Change-Id: I0ab88d0991761c058b6af81d6d26402ff370b78e
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 4105: Add hasOwner param to EntityOwnershipListener#ownershipChanged 58/26858/5
Tom Pantelis [Fri, 11 Sep 2015 04:13:51 +0000 (00:13 -0400)]
Bug 4105: Add hasOwner param to EntityOwnershipListener#ownershipChanged

OF clustering needs to know when the last candidate is removed for an
entity so it can clean up inventory. We decided to add a new param,
hasOwner, passed to EntityOwnershipListener#ownershipChanged to indicate if
there is at least one remaining candidate and current owner when a
controller node loses ownership. So if
wasOwner=true && isOwner=false && hasOwner=false, the OF code can
remove the device node from inventory.

To simplify the EntityOwnershipListener#ownershipChanged interface and
to allow for possible future parameters w/o breaking the interface, the
parameters are now encapsulated in an EntityOwnershipChanged DTO. There
already was the same EntityOwnershipChanged class in
sal-distributed-datastore - this class was removed.

Change-Id: I07375f154ac55d34062380ad6d0b30d970bd28e7
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoCDS: Fix intermittent DistributedDataStoreRemotingIntegrationTest failure 68/26868/1
Tom Pantelis [Thu, 10 Sep 2015 17:24:01 +0000 (13:24 -0400)]
CDS: Fix intermittent DistributedDataStoreRemotingIntegrationTest failure

I've seen the testReadyLocalTransactionForwardedToLeader test fail
several times both locally and in jenkins:

DistributedDataStoreRemotingIntegrationTest.testReadyLocalTransactionForwardedToLeader:535
assertion failed: expected class
org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages$CommitTransactionReply, found class akka.actor.Status$Failure

It's a timing issue where the follower may not yet have the leader.
After this patch the test ran 100 times w/o failure.

Change-Id: I542a7e87516e8d1f846cda6e2abc4d473e3de961
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
(cherry picked from commit 7fd01f9dc19ef8f02c1b70973fcb091dc0ad8b1e)

8 years agoBug 4105: Fixed feature test failure due to missing dependency. 24/26824/2
Shigeru Yasuda [Fri, 11 Sep 2015 08:06:51 +0000 (17:06 +0900)]
Bug 4105: Fixed feature test failure due to missing dependency.

features-mdsal was missing dependency on sal-clustering-config
(type=xml, classifier=entityownershipconfig).

Change-Id: Ifa1380a1071ae3c7b730e79c4e1c8ff09dbe15e2
Signed-off-by: Shigeru Yasuda <s-yasuda@da.jp.nec.com>
(cherry picked from commit 12e9ea641e6cfca47e1c232b788acd6ece5364ba)

8 years agoBUG 4291 : odl-clustering-test-app feature must depend on odl-mdsal-broker 12/26812/1
Moiz Raja [Fri, 11 Sep 2015 01:33:38 +0000 (18:33 -0700)]
BUG 4291 : odl-clustering-test-app feature must depend on odl-mdsal-broker

When odl-clustering-test-app feature depends on odl-mdsal-broker-local the
distributed-entity-ownership service does not get resolved.

Change-Id: I0240ea6b210ec5966f680f786a706365b4f6502c
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoBug 4105: Remove candidates on PeerDown 96/26696/2
Tom Pantelis [Tue, 18 Aug 2015 06:59:47 +0000 (02:59 -0400)]
Bug 4105: Remove candidates on PeerDown

Currently on PeerDown, the EntityOwnershipShard selects a new owner for
the entities owned by the down node and leaves the down node as a
candidate. If the down node is the only candidate, the owner is cleared.
On PeerUp, it selects a new owner for those entities whose owner is clear.
This was done to handle network partition so a node's candidates remain
registered and are re-assigned when the partition is healed.

Howver this has potential issues when a node is actually
stopped/restarted. It's possible, on restart, that the node doesn't
register a candidate for an entity that it had previously registered for.
So it may get ownership of an entity for which it has no registered
candidate.

To alleviate this, I changed it to remove all the down node's candidates
on PeerDown. If the node was stopped/restarted, then it will
re-register candidates based on local client requests. This case will be
the norm. To handle network partition, when healed, the follower node
will get the replicated commits for its candidate removals from the
leader. So on Candidate removed, it re-adds its removed candidate if it
has a registered EntityOwnershipCandidate.

I realized that one can register a DOMDataTreeChangeListener for a leaf
node. So I simplified EntityOwnerChangeListener to listen for the owner
leaf instead of the entity path. This avoids the extra notifications
when candidayes are added/removed. I actually did this originally b/c I
thought there was a bug when listening at the entity level which turned
out there wasn't but I left it in as an improvement.

I also added the shard's logId to the listener and support classes for
better debugging of unit tests.

Change-Id: I75d2567ce54b9129eee052ba521c8a71777289b6
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 4105: Implement EntityOwnershipListener registration/notification 95/26695/2
Tom Pantelis [Mon, 17 Aug 2015 09:57:53 +0000 (05:57 -0400)]
Bug 4105: Implement EntityOwnershipListener registration/notification

Change-Id: I49ee7f4b5f48ddde4779d37ba34c88dd776dd47b
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 4105: Pass ModuleShardConfiguration with CreateShard 94/26694/2
Tom Pantelis [Mon, 17 Aug 2015 00:46:24 +0000 (20:46 -0400)]
Bug 4105: Pass ModuleShardConfiguration with CreateShard

The DistributedEntityOwnershipService first adds the
ModuleShardConfiguration to the Configuration prior to sending the
CreateShard message. However if the ModuleShardConfiguration gets
added before the ShardManager actor is created, the entity-ownership
shard is created via ShardManager.createLocalShards. This results in
the entity-ownership instantiated as Shard instead of
EntityOwnershipShard. I've seen this happen in unit tests - it's not
likely to occur in the production system b/c we wait until the
data store is ready prior to creating the
DistributedEntityOwnershipService. But we should prevent it so I
changed the DistributedEntityOwnershipService to pass the
ModuleShardConfiguration with the CreateShard message. The
ShardManager now adds the ModuleShardConfiguration to the
Configuration.

Change-Id: I9f64a27cdd8c24d31e7eb1389210b57ac7a1f604
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 4105: Add entity ownership integration test 93/26693/2
Tom Pantelis [Sun, 16 Aug 2015 23:02:41 +0000 (19:02 -0400)]
Bug 4105: Add entity ownership integration test

Change-Id: I9578a37f86db44a90aa208d6d89374ba4d3cfb89
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 4105: Change ownership on member down/up 92/26692/2
Tom Pantelis [Sat, 15 Aug 2015 21:23:50 +0000 (17:23 -0400)]
Bug 4105: Change ownership on member down/up

Added 2 new messages, PeerUp and PeerDown, that the ShardManager sends
in response to cluster member events.

For PeerDown, the EntityOwnershipShard finds the entities owned by the
down member and selects a new owner based on the remaining candidates.
If there's no other candidates, the owner is cleared (set to "") so new
candidates can become owner. The down members are also tracked via a
downPeerMemberNames set.

For PeerUp, if the up member is in the downPeerMemberNames, the
EntityOwnershipShard finds entities that previously had their owner
cleared and attempts to select a new owner. This handles the case where
a previously down member was the only candidate for an entity so, when
that member comes back up, the entity's owner will be re-assigned to
that member.

Reassigning of owners via PeerDown and PeerUp is only done on the
leader. However that may not handle the case where the leader goes down.
When a new leader is elected we need it to select new owners for
entities owned by the down leader. There are 2 cases here. If the old
leader has not yet been detected as down then eventually we expect to
get PeerDown to handle it. The second case is if PeerDown was already
received prior to the leader change (probably the norm), in which case
PeerDown would not have been processed. To handle this case I overrode
onLeaderChanged to select new owners for entities owned by the old leader
that is passed in. The RaftActor sends the old leader's peerId so I
added a peerIdToMemberNames map to translate - this is populated via
PeerUp. Also I changed the RaftActor to track and pass the actual last valid
leader id, previously it passed the leader id from the previous behavior
which would normally be Candidate which always has a null leaderId.

The newOwner method was changed to ignore candidates in the
downPeerMemberNames set as there's no point in assigning the owner to a
candidate known to be down.

Change-Id: I8f0b78460a1a3e2a6418431f8a8a770a789e8f8d
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 4105: Add Cars RPC to test entity ownership 91/26691/3
Tom Pantelis [Wed, 12 Aug 2015 04:59:46 +0000 (00:59 -0400)]
Bug 4105: Add Cars RPC to test entity ownership

Change-Id: I8e23698b64ef408ae157ca0d2e94ed1f272128c7
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 4105: Add general-entities yang model 90/26690/3
Tom Pantelis [Wed, 12 Aug 2015 04:57:45 +0000 (00:57 -0400)]
Bug 4105: Add general-entities yang model

Added a general-entities yang model tha can be used to represent an
entity ID when no existing yang schema exists.

Change-Id: Iec815966fe21ec15cb78ff47c68cda0aa7ae8504
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 4105: Add dynamic module/shard config for entity-owners shard 89/26689/3
Tom Pantelis [Tue, 11 Aug 2015 00:08:03 +0000 (20:08 -0400)]
Bug 4105: Add dynamic module/shard config for entity-owners shard

Added a new method addModuleShardConfiguration to Configuration.

I simplified the internals of ConfigurationImpl to make it easier to
add a new module/shard config. I combined serveral of the maps into one
moduleConfigMap and reduced the total # of fields to 3. For
synchronization, I kept the maps/sets immutable and used copy-on-write
semantics to update them as they will seldom change. I also made the
fields volatile.

I also removed the singleton nature of ShardStrategyFactory since each
datastore's Configuration will now be different, ie only the operational
datastore's Configuration will have the entity-owners module. The
datastore's ShardStrategyFactory instance is not instantiated and owned
by the ActorContext.

To make things easier for unit tests, I abstracted the file-reading code
in ConfigurationImpl to a new ModuleShardConfigProvider interface and
FileModuleShardConfigProvider implementation in the config package.
I also moved the inner classes to the config package.

While I was at it I also moved Configuration and ConfigurationImpl to the
config package for consistency.

Change-Id: I1d6858d3ae68869ca6f61d4f5a5f0d319d93c485
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 4105: Implement UnregisterCandidateLocal in EntityOwnershipShard 88/26688/3
Tom Pantelis [Fri, 14 Aug 2015 12:42:02 +0000 (08:42 -0400)]
Bug 4105: Implement UnregisterCandidateLocal in EntityOwnershipShard

Also added a testOwnershipChanges case to EntityOwnershipShardTest to
run thru various ownership change scenarios with local and remote candidates
and local unregistration. As a result I found a couple bugs that I
fixed.

Change-Id: I4343754fbbc8f471975e6c723ffc0beaedee2860
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 4105: Integrate EntityOwnerChangeListener with EntityOwnershipShard 87/26687/3
Tom Pantelis [Fri, 14 Aug 2015 10:13:54 +0000 (06:13 -0400)]
Bug 4105: Integrate EntityOwnerChangeListener with EntityOwnershipShard

Change-Id: Ia302d503f9ff65aa48faf7d69f1405ebf5267166
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 4105: Choose Owner for an Entity based on first come first served basis 86/26686/3
Moiz Raja [Wed, 19 Aug 2015 23:53:10 +0000 (16:53 -0700)]
Bug 4105: Choose Owner for an Entity based on first come first served basis

Change-Id: If40e19cf40e832c9317611bde2950502f7f4897c
Signed-off-by: Moiz Raja <moraja@cisco.com>
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 4105: Change commit retry mechanism in EntityOwnershipShard 85/26685/2
Tom Pantelis [Fri, 14 Aug 2015 03:21:56 +0000 (23:21 -0400)]
Bug 4105: Change commit retry mechanism in EntityOwnershipShard

Change-Id: Iba640eab1c21672ffe6357531c6d236e65c1cd73
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 4105: Add EntityOwnerDataChangeListener 84/26684/2
Tom Pantelis [Wed, 12 Aug 2015 19:51:54 +0000 (15:51 -0400)]
Bug 4105: Add EntityOwnerDataChangeListener

Added EntityOwnerDataChangeListener that responds to changes to the
entity owner leaf and notifies the EntityOwnershipListenerSupport
appropriately.

I also added an EntityOwnersModel class that defines various entity-owners
yang model constants (moved from EntityOwnershipShard) and has utilities
for creating NormalizedNodes and paths.

Change-Id: Iaa567b5cba6cf0f5cfca0dce39f0f43c38fee4bc
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 4105: Add EntityOwnershipListenerActor and support 83/26683/2
Tom Pantelis [Tue, 11 Aug 2015 04:05:38 +0000 (00:05 -0400)]
Bug 4105: Add EntityOwnershipListenerActor and support

Change-Id: Idbeef3e23ab45a11afe5fce56a55fe5d6945729a
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 4105: Move Configuration classes to config package 82/26682/2
Tom Pantelis [Fri, 14 Aug 2015 02:16:06 +0000 (22:16 -0400)]
Bug 4105: Move Configuration classes to config package

Change-Id: I863600727f5171eb0db3591a541848aa877a68de
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 4105: Implement RegisterCandidate in EntityOwnershipShard 81/26681/2
Tom Pantelis [Sun, 9 Aug 2015 04:22:02 +0000 (00:22 -0400)]
Bug 4105: Implement RegisterCandidate in EntityOwnershipShard

Change-Id: Idab615399d81a8451e22bfabd30aed9a98e4b037
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 4105: Implement candidate registration close 80/26680/2
Tom Pantelis [Sat, 8 Aug 2015 10:57:03 +0000 (06:57 -0400)]
Bug 4105: Implement candidate registration close

Added an UnregisterCandidateLocal message which is sent when
a DistributedEntityOwnershipCandidateRegistration is closed.

Change-Id: I6336e1b83a7764bfb4abc2fc37e196175c008dc3
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug4105: Implement DistributedEntityOwnershipService#registerCandidate 79/26679/2
Tom Pantelis [Sat, 8 Aug 2015 08:20:11 +0000 (04:20 -0400)]
Bug4105: Implement DistributedEntityOwnershipService#registerCandidate

Added a RegisterCandidateLocal message and implemented registerCandidate
to send the message to the local EntityOwnershipShard.

Change-Id: If941401d00912ce34f74e54188af0430a5ec6fcc
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 4105: Add EntityOwnershipShard 78/26678/3
Tom Pantelis [Fri, 7 Aug 2015 20:20:48 +0000 (16:20 -0400)]
Bug 4105: Add EntityOwnershipShard

Added the EntityOwnershipShard and modified
DistributedEntityOwnershipService to create it.

Change-Id: Id173b148797e90ff5d38d7f7cde177d303943181
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoentity-owners.yang module 75/24775/4
Moiz Raja [Tue, 4 Aug 2015 20:00:52 +0000 (13:00 -0700)]
entity-owners.yang module

This module describes the data structure used for storing entity
ownership information by the clustered implementation of
EntityOwnershipService

Change-Id: Ib7f8fad74e00b480236b1a2bddb060b093e90ad4
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoBug 4105: Added DistributedEntityOwnershipService and wiring 77/26677/2
Tom Pantelis [Fri, 7 Aug 2015 16:55:48 +0000 (12:55 -0400)]
Bug 4105: Added DistributedEntityOwnershipService and wiring

Added a skeleton DistributedEntityOwnershipService impl class and config
system wiring.

I initially tried to instantiate it in the operational store module but
it needs to be its own service and AFAIK you can only provide one
service per module as createInstance returns a single AutoCloseable.

So I created a new config yang and xml for distributed-entity-ownership-service.
We also need a separate config yang service identity to allow for
multiple impls - I put this in sal-common-api where the
EntityOwnershipService is defined.

Change-Id: I4883af2e749bca5c9dfdac69cf943017294435a3
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 4105: Add public EntityOwnershipService interface 06/24706/3
Moiz Raja [Fri, 31 Jul 2015 22:40:17 +0000 (15:40 -0700)]
Bug 4105: Add public EntityOwnershipService interface

Change-Id: If65f6ef8116b0a8481a3af1aee88e444771d9e3f
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoBug 4105: Add CreateShard message in ShardManager 76/26676/1
Tom Pantelis [Thu, 6 Aug 2015 20:13:03 +0000 (16:13 -0400)]
Bug 4105: Add CreateShard message in ShardManager

Added a new CreateShard message that is processed by the
ShardManager. A new interface, ShardPropsCreator, was added
allowing the caller to instantiate a sub-class of Shard if need be
via the CreateShard message. The DefaultShardPropsCreator creates
Props for the Shard class.

Change-Id: Ieb2c895c85709d963445dc7e15ae9dec9cb3a810
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 4105: Add method to get all unique member names 75/26675/1
Tom Pantelis [Wed, 5 Aug 2015 22:15:42 +0000 (18:15 -0400)]
Bug 4105: Add method to get all unique member names

Added a method to Configuration to get all unique members names
configured for all shards.

Change-Id: I09993541ad7e5963e9eef9cb58b4376daa8f09e8
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBUG 2185: Expand the scope of sync status to cover a slow follower 13/26113/4
Moiz Raja [Sat, 22 Aug 2015 02:13:05 +0000 (19:13 -0700)]
BUG 2185: Expand the scope of sync status to cover a slow follower

Previously sync status was used only in the startup scenario
to make the controller appear to the external world as not
synced up unless it had received atleast data till the commitIndex
which the leader reported when it sent the follower it's first
heartbeat.

Now we also track when a new update is sent from the Leader to the
Follower and if the Follower is behind the Leader by a threshold
(hardcoded for now) then we consider the Follower as out-of-sync

Also I added the member name in the ShardManager bean so that is another
place from which we can figure out on which node we are running.

Change-Id: I1ba02575a0a1ac5d601af559f41971f2f5736f9d
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoBug-4234 - Add count field to cars stress-test RPC. 12/26412/3
Shaleen Saxena [Wed, 2 Sep 2015 17:19:51 +0000 (13:19 -0400)]
Bug-4234 - Add count field to cars stress-test RPC.

Added a 'count' field to cars stress-test RPC. The test will stop
after the 'count' cars have been created. If count is zero, then
stress-test will continue till stop-stress-test rpc is given.

Also added some null checks for missing input fields. If rate is
zero, then an error is returned.

Change-Id: Id313f9094e8ca887993e4e8911d0a86b64db7303
Signed-off-by: Shaleen Saxena <ssaxena@brocade.com>
8 years agoBUG 2185 : Follower should request forceInstallSnapshot in out-of-sync scenario 42/24742/7
Moiz Raja [Tue, 4 Aug 2015 00:05:14 +0000 (17:05 -0700)]
BUG 2185 : Follower should request forceInstallSnapshot in out-of-sync scenario

When the Follower detects that it has more entries in it's log than the Leader
it might be an indication that the Follower was previously a Leader and therefore
it has additional entries in it's log which are missing in the Leader. When the
RaftPolicy is set to allow commits before consensus this could also mean that the
state now has more data than should be present in there. In this scenario Follower
requests the Leader to InstallSnapshot.

Change-Id: I517af148c3933f798ceb87ff88c77c396590881f
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoBUG 2185 : Disable all internal switching of behavior 38/24738/7
Moiz Raja [Mon, 3 Aug 2015 23:20:31 +0000 (16:20 -0700)]
BUG 2185 : Disable all internal switching of behavior

Since we do not depend on Raft for changing behavior when elections
are disabled we need to disable all internal switching of behaviors.

Added specific Leader tests to check the following,
1. Do not switch to Follower when you receive an AppendEntriesReply
   from a Follower with a higher term
2. Do not switch to IsolatedLeader even when no Follower is sending
   AppendEntriesReply

Change-Id: Ic2b4f76813f35db190e108306a62af5397d31658
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoBug-4214 - Add support for configurable snapshot chunk size. 04/26204/2
Shaleen Saxena [Mon, 31 Aug 2015 02:25:19 +0000 (22:25 -0400)]
Bug-4214 - Add support for configurable snapshot chunk size.

Added a new variable in the distributed-datastore-provider.yang. This
will be used to configure the snapshot chunk size. Added various
setters/getters to the DatastoreContext. The support for this variable
was added to JMX as well, so that the value can be seen via JConsole.
Moreover, added tests in DatastoreContextTest.

Also fixed a recurring typo in sal-akka-raft. Snapshot was spelled as
snaphot (missing s in shot).

This code was unit tested with different entries in datastore.cfg. Also
tested the case where no special value was provided in datastore.cfg,
and the default value was shown in jconsole.

Change-Id: Ie754075cc25f9eadf01cc65aee726735144c1794
Signed-off-by: Shaleen Saxena <ssaxena@brocade.com>
8 years agoBUG 2185 : Add JMX API to change the state of a Shard 95/24495/6
Moiz Raja [Fri, 24 Jul 2015 02:19:16 +0000 (19:19 -0700)]
BUG 2185 : Add JMX API to change the state of a Shard

Added two APIs to the ShardManager MBeans
- switchAllLocalShardsState
- switchShardState

Change-Id: I896e421f322f487b4f8eb321708e01cc93bbd48f
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoEnabling Data Change Notifications for all nodes in cluster. 22/24522/7
Harman Singh [Fri, 24 Jul 2015 01:32:46 +0000 (18:32 -0700)]
Enabling Data Change Notifications for all nodes in cluster.

Two new interfaces are introduced ClusteredDataChangeListener and ClusteredDOMDataChangeListener and external applications will have to implement any of that interface,
if those applications want to listen to remote data change notifications.

Datastore registers listeners, which are instance of that interface, even on followers.

Change-Id: I0e29cdf2a08a2051de5fc8ce73b9ec8ac408e45b
Signed-off-by: Harman Singh <harmasin@cisco.com>
(cherry picked from commit 66a6b6f931af3fcd1ce61263c457304cfbdc2bb5)

8 years agoBUG 4212 : Follower should not reschedule election timeout in certain cases. 00/26100/4
Moiz Raja [Thu, 27 Aug 2015 17:34:36 +0000 (10:34 -0700)]
BUG 4212 : Follower should not reschedule election timeout in certain cases.

Before:
Follower rescheduled election whenever it received any message

Now:
Followe reschedules election only if
    - The message received is a RaftRPC message
    - If the RaftRPC message is a RequestVote then only reschedule
      if vote is granted

Change-Id: Ia59c65e4896d72dfc49e86e59b6a9e9331a945ca
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoBUG 4213 : Candidate should switch to Follower when it receives AppendEntries from... 02/26102/2
Moiz Raja [Thu, 27 Aug 2015 18:07:08 +0000 (11:07 -0700)]
BUG 4213 : Candidate should switch to Follower when it receives AppendEntries from new Leader

Multiple peers might become candidates in a single election term. If one peer happened
to become a Leader it will send AppendEntries to all it's peers. When a Candidate receives
an AppendEntries and finds its term to be the same as the AppendEntries term then it should
switch to Follower.

Change-Id: Ia4ce41d4f3eefed50297b90107ad7429bb950ad8
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoBug 3708 - APIdoc explorer URLs contain extra 'node' in REST calls 88/25688/2
Jan Hajnar [Thu, 25 Jun 2015 12:06:33 +0000 (14:06 +0200)]
Bug 3708 - APIdoc explorer URLs contain extra 'node' in REST calls

* fixed mount point path builder that added each list qname twice

Change-Id: Ie54919666909dee3fc297b2155c2afea10a4477f
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
8 years agoRe-enable tests and bump aaa version 91/25691/1
Thanh Ha [Sat, 22 Aug 2015 06:20:10 +0000 (02:20 -0400)]
Re-enable tests and bump aaa version

This patch is part 2 of 2 patches:

* Increments the version of the depenency on AAA from 0.2.1-Lithium-SR1
* to 0.2.2-SNAPSHOT.
* Re-enables the feature tests for the restconf and netconf-conector
  features.

Change-Id: Ifd57e7d9c2864ac5178946fb7e08d0bc48eb0fae
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoBumping versions by 0.0.1 after the Lithium SR1 release 87/25687/2
Thanh Ha [Sat, 22 Aug 2015 03:37:27 +0000 (23:37 -0400)]
Bumping versions by 0.0.1 after the Lithium SR1 release

This patch is part 1 of 2 patches.

* The only version not incrmented is aaa.version, which is left at
  0.2.1-Lithium-SR1 since they depend on controller and can't update yet.
* To break the cyclic dependency, this patch temporarily stops running
  the netconf-connector and restconf feature tests.

A second patch (to be run after AAA increments their versions to
0.2.2-SNAPSHOT) will update aaa.version and re-enable these tests.

Change-Id: I023b7c4242e225fcc31a891ab671af2aa5374ef8
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoApplying the Lithium SR1 release patch 86/25686/1 release/lithium-sr1
Thanh Ha [Sat, 22 Aug 2015 03:37:21 +0000 (23:37 -0400)]
Applying the Lithium SR1 release patch

Change-Id: I4153146b3e61077efd84cb0e35616233fb5294ac
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoRevert "Bug 3708 - APIdoc explorer URLs contain extra 'node' in REST calls" 85/25685/1
Thanh Ha [Sat, 22 Aug 2015 03:37:05 +0000 (23:37 -0400)]
Revert "Bug 3708 - APIdoc explorer URLs contain extra 'node' in REST calls"

This reverts commit 523e75af81fa6537117ceae53c7cdb2b1881aa10.

Change-Id: I01ac3d2176f9fcb08151bd35dcd2eed8c961992b
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoBug 3708 - APIdoc explorer URLs contain extra 'node' in REST calls 67/23267/3
Jan Hajnar [Thu, 25 Jun 2015 12:06:33 +0000 (14:06 +0200)]
Bug 3708 - APIdoc explorer URLs contain extra 'node' in REST calls

* fixed mount point path builder that added each list qname twice

Change-Id: I96d541ea8b40ab5003f82a9e5981e11e1f0fd0d2
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
8 years agoDistribution-karaf fails with error factory already defined 18/25318/1
Thanh Ha [Fri, 14 Aug 2015 21:05:59 +0000 (17:05 -0400)]
Distribution-karaf fails with error factory already defined

Revert "Fix versions to stable/lithium"

This reverts commit d720d5e4c8c9baa7bee2a6bbca467a901fbc0f7d.

Revert "Backport mvn archetypes to stable/lithium."

This reverts commit 1254e0f95ed295bfa7fb1189ee52749d927d0968.

Bug: 4141
Change-Id: I7b4323a9b2e8e669a2b0dd69a4f2acd77362849c
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoBug 3822: Improve error reporting for restconf PUT 43/23043/5
Tom Pantelis [Sat, 20 Jun 2015 08:09:47 +0000 (04:09 -0400)]
Bug 3822: Improve error reporting for restconf PUT

A runtime exception can be emitted by the netconf mount point which
should be reported to the user, otherwise you get a 500 response with
no error info which isn't very helpful.

Also the fucntionality to output the error-info field was ommitted with
the conversion from CompositeNode to NormalizedNode so I re-implemeneted
it. It was originally ommitted with a TODO b/c the
NormalizedNodeStreamWriters validate against the schema and error-info
is defined as an empty container in the restconf yang. So there's no way
to create a ContainerNode to represent the error-info data that conforms
to the schema. To work around this, I created a leaf node and special-cased
error-info in the stream writer to elide schema validation.

I also added a regression unit test for the case where the URL contains
an identityref.

Change-Id: I4bb0d767bb8008023e7ef10a439025e2e591f9cd
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoFix versions to stable/lithium 67/25167/2
Thanh Ha [Tue, 11 Aug 2015 17:48:00 +0000 (13:48 -0400)]
Fix versions to stable/lithium

Fixes version issue caused by:

    https://git.opendaylight.org/gerrit/24705/

Change-Id: I973dcded34f0490cbd4210022681ec38414d6016
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoCDS: Include CAN_COMMIT phase in rate limiter time period 88/23888/4
Tom Pantelis [Thu, 2 Jul 2015 02:53:56 +0000 (22:53 -0400)]
CDS: Include CAN_COMMIT phase in rate limiter time period

I was testing with simulated latency in the followers. With a high enough
latency and tx thru-put, the pending commit queue in the
ShardCommitCoordinator got increasingly behind until latencies built up
enough to cause AskTimeoutExeption's on the front-end.

The rate limiter was throttling but not enough. I realized that the rate
limiter times the commit phase but not the canCommit phase. The latter is
what times out with pending tx's sitting in the queue waiting for canCommit.
So I changed ThreePhaseCommitCohortProxy to also time the canCommit
phase. This alleviated the timeouts - even with a really high max latency of
500 ms and 100 tx / sec client thru-put. The rate limiter thru-put
reduced it to about 3 / sec.

Change-Id: I6dc73d1d657519b9410ad034c69d26f19a0cb263
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBUG 2185 : Introduce the SwitchBehavior message 59/24459/5
Moiz Raja [Thu, 23 Jul 2015 03:34:30 +0000 (20:34 -0700)]
BUG 2185 : Introduce the SwitchBehavior message

RaftActor processes the SwitchBehavior message to change the behavior
Candidate and IsolatedLeader behaviors are not allowed.

Change-Id: Id8d758c6574a5c58927927b83bc5985081b19c50
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoCDS: Add stress test RPC to the cars model 99/23899/4
Tom Pantelis [Tue, 7 Jul 2015 20:07:38 +0000 (16:07 -0400)]
CDS: Add stress test RPC to the cars model

For stress testing the CDS, I've been using an RPC that continuously
creates cars at a specified per second rate. I thought it might be
useful to submit it.

Change-Id: I33b9c2e304884b9541774a12ee248082de60f72e
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>