controller.git
8 years agoRelease Lithium-SR4 06/35706/1 release/lithium-sr4
Thanh Ha [Fri, 4 Mar 2016 00:31:47 +0000 (19:31 -0500)]
Release Lithium-SR4

Change-Id: Ie49f4f97dea7bad87f358284962f6529d93cf823
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoMake mdsal datastore persist through different sessions 05/34905/3
Tomas Cere [Thu, 18 Feb 2016 14:05:26 +0000 (15:05 +0100)]
Make mdsal datastore persist through different sessions

Each device needs cached set of datastore operations.

Port of:
https://git.opendaylight.org/gerrit/#/c/31708/

Change-Id: I713a5d4bc406eebcaecadc90d219a439b9526385
Signed-off-by: Tomas Cere <tcere@cisco.com>
8 years agoBug 4455 - Inconsistent COMMIT operation handling when no transactions are present 95/34895/2
Tomas Cere [Thu, 18 Feb 2016 11:40:52 +0000 (12:40 +0100)]
Bug 4455 - Inconsistent COMMIT operation handling when no transactions are present

Return positive response for commit operation in netconf mdsal
northbound even if no candidate transaction is open for session.

port of:
https://git.opendaylight.org/gerrit/#/c/32938/

Change-Id: I892679d2d4ba50ecb887aefccac5b7d4ef6639f8
Signed-off-by: Tomas Cere <tcere@cisco.com>
8 years agoBug 4455 - Inconsistent COMMIT operation handling when no transactions are present 94/34894/2
Jakub Morvay [Thu, 14 Jan 2016 16:02:42 +0000 (17:02 +0100)]
Bug 4455 - Inconsistent COMMIT operation handling when no transactions are present

Return positive response for commit operation in config subsystem
netconf northbound even if no candidate transaction is open for session.

Port of:
https://git.opendaylight.org/gerrit/#/c/32940/

Change-Id: Ia6ce2aa6ffdfafc47f69ae7315669f64b653c514
Signed-off-by: Jakub Morvay <jmorvay@cisco.com>
8 years agoFix netconf-config-connector NetconfMappingTest 93/34893/2
Tomas Cere [Thu, 18 Feb 2016 11:37:37 +0000 (12:37 +0100)]
Fix netconf-config-connector NetconfMappingTest

Since commit operation does not fail when no transaction is
present, remove test expecting exception in such case.

port of:
https://git.opendaylight.org/gerrit/#/c/32598/

Change-Id: I4b025ae6ed73bbbdde928920b5f5f06d1115f482
Signed-off-by: Tomas Cere <tcere@cisco.com>
8 years agoBUG 5125: Fix NPE on module's with unknown namespace 86/34886/2
Tomas Cere [Thu, 18 Feb 2016 10:24:04 +0000 (11:24 +0100)]
BUG 5125: Fix NPE on module's with unknown namespace

port of:
https://git.opendaylight.org/gerrit/#/c/33904/2

Change-Id: Ib5e4f3d01a710e1a8e4f11bb01ba26f643d88ab0
Signed-off-by: Tomas Cere <tcere@cisco.com>
8 years agoImplement md-sal datastore into netconf test-tool 04/34904/2
Tomas Cere [Thu, 18 Feb 2016 12:26:32 +0000 (13:26 +0100)]
Implement md-sal datastore into netconf test-tool

Port of:
https://git.opendaylight.org/gerrit/#/c/26094/

Change-Id: Ia20302e1d6f6cbe6d40628e2af3ad5f14c39f55e
Signed-off-by: Tomas Cere <tcere@cisco.com>
8 years agoBug 3934: Websockets: Scope ONE doesn't work correctly 87/34887/2
Martin Ciglan [Thu, 18 Feb 2016 10:24:14 +0000 (11:24 +0100)]
Bug 3934: Websockets: Scope ONE doesn't work correctly

Based on this patch, data change event in notification
contains also data, so there is no need for subsequent
request to get it. This is port from Beryllium.

Change-Id: I9d5c4e6c5b0ad4a415fddc1677fd22a6d294dee0
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
8 years agoAPI Doc Explorer crashes if a yang file on a mounted resource does not have a version 27/34627/4
Balaji Varadaraju [Sun, 14 Feb 2016 08:39:53 +0000 (02:39 -0600)]
API Doc Explorer crashes if a yang file on a mounted resource does not have a version

The fix for bug 3782  was checking for dates less than 1970 ( default date when there is no version).
The fix is to check for less than or equal to 1970. The existing code works fine for US time zones
because all US time zones are behind GMT and hence the local time for EPOCH date results in year 1969.
However when in other time zones such as in Europe the year part of the EPOCH date results in 1970.
This is a simple fix to correct that.

Change-Id: I03f9850eaa25a7fbc12895ee0a9eef059a319613
Signed-off-by: Balaji Varadaraju <bvaradar@brocade.com>
8 years agoBug 4850: Fix follower out-of-sync logic wrt replicatedToAllIndex 26/34826/1
Tom Pantelis [Wed, 30 Dec 2015 02:39:55 +0000 (21:39 -0500)]
Bug 4850: Fix follower out-of-sync logic wrt replicatedToAllIndex

If the AppendEntries prevLogIndex is -1 and replicatedToAllIndex != -1,
it flags the follower as out-of-sync if there's no log entry for
replicatedToAllIndex. However replicatedToAllIndex may be in the
snapshot so I added a check for that as well. This fixes the issue
described in bug 4850.

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

8 years agoBackport NPE fix in SnapshotManager 59/34359/2
Tom Pantelis [Tue, 9 Feb 2016 21:11:30 +0000 (16:11 -0500)]
Backport NPE fix in SnapshotManager

Backported  https://git.opendaylight.org/gerrit/#/c/26132/ that fixed
an NPE in the SnapshotManager if there is no log entry from which to obtain
the last term/index for the snapshot. In this case it uses the last
applied term/index.

Change-Id: Iabd7f7467fa09a71576611e8261a3c985e62a97c
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 5175: RPC called on mount point not being correctly handled when multiple revisio... 18/33918/1
adetalhouet [Tue, 2 Feb 2016 17:36:17 +0000 (12:36 -0500)]
Bug 5175: RPC called on mount point not being correctly handled when multiple revision-date coexist

The ControllerContext#toQname was just looking for module using the module name.
In scenarios where you have multiple revision for the same module, the method
was returning the latest schema.

This fix is to retreive the schema based on the revision date

Change-Id: Ief10dab8925bc942f446895fe7078ebcb1105a3a
Signed-off-by: adetalhouet <adetalhouet@inocybe.com>
8 years agoBug 3015 - netconf: Un-helpful error message presented when no service 77/23277/3
Jan Hajnar [Thu, 25 Jun 2015 14:43:26 +0000 (16:43 +0200)]
Bug 3015 - netconf: Un-helpful error message presented when no service
provider is there to handle the RPC call.

* added catch in checkRpcResponse when cause of error is unimplemented
rpc service

Change-Id: I5b19827c63cd4b7962f55da79d4887bbff6b68ca
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
8 years agoAdd logging for RPC calls. 01/32201/6
adetalhouet [Wed, 6 Jan 2016 19:39:29 +0000 (14:39 -0500)]
Add logging for RPC calls.

Change-Id: I173a41401ce5f12a8f38844f4653882be66467da
Signed-off-by: adetalhouet <adetalhouet@inocybe.com>
8 years agoBug 4940 - correctly implement default-request-timeout-millis 28/32428/7
adetalhouet [Mon, 18 Jan 2016 21:12:14 +0000 (16:12 -0500)]
Bug 4940 - correctly implement default-request-timeout-millis

Change-Id: I6922839d08459e3fd5225ff08213daf646608eaf
Signed-off-by: adetalhouet <adetalhouet@inocybe.com>
8 years agoFix non ietf-netconf* mounted RPC invocation from Restconf 95/31495/2
Maros Marsalek [Thu, 17 Dec 2015 11:21:42 +0000 (12:21 +0100)]
Fix non ietf-netconf* mounted RPC invocation from Restconf

Invoked RPCs from modules other than iet-netconf* were executed on ODL itself
instead of a mountpoint regardless of whether they were aimed at a mountpoint
or not.

Change-Id: I8ac4fea41e553680f270825376b57a534b2ffa95
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
8 years agoBug 4709 - Add keepalive response timeout to KeepaliveSalFacade of netconf connector. 68/30668/14
adetalhouet [Mon, 4 Jan 2016 17:59:10 +0000 (12:59 -0500)]
Bug 4709 - Add keepalive response timeout to KeepaliveSalFacade of netconf connector.

Change-Id: I8b1a5b6a2003b0d35c8acc463621145e04164e4f
Signed-off-by: adetalhouet <adetalhouet@inocybe.com>
8 years agoBUG 4547: Make sure all channel writes are from a netty thread. 92/32492/2
Tomas Cere [Wed, 13 Jan 2016 11:49:48 +0000 (12:49 +0100)]
BUG 4547: Make sure all channel writes are from a netty thread.

When we were in restconf thread some writes were executed from jetty thread,
we need to make sure all channel writes are coming from netty thread to
preserve message ordering.

Port of:
https://git.opendaylight.org/gerrit/#/c/32272/5

Change-Id: I19ba295905de5fce3cb84e6d5285a2ddf73c54c1
Signed-off-by: Tomas Cere <tcere@cisco.com>
8 years agoBug 4114 - netconf connector replace causes transaction chain failure 52/32352/5
adetalhouet [Mon, 11 Jan 2016 18:02:20 +0000 (13:02 -0500)]
Bug 4114 - netconf connector replace causes transaction chain failure

In order to avoid race condition when txChain perform delete then write
transactions in a row to the same path, perfom the delete as a blocking
transaction so once done, write can be perform without any race condition

Also reset the txChain after a failure.

Change-Id: Ic48d2993318d22f7af2e6aba49d718677a05ea3d
Signed-off-by: adetalhouet <adetalhouet@inocybe.com>
8 years agoBug 4948: Catch RuntimeException from ensureParentByMerge 57/32457/3
Balaji Varadaraju [Wed, 13 Jan 2016 00:17:02 +0000 (18:17 -0600)]
Bug 4948: Catch RuntimeException from ensureParentByMerge

Made the calls to PUT and POST more robust. Caught the RuntimeException from
 the merge call in the EnsureParentsByMerge. If this fails then started
a new transaction and continue with the original PUT. This ensures when a device
is unable to handle the empty list/container merge it will still succeed with the
original request. Similar change has been made for POST.

Change-Id: Icd904b001806dcee2a02eb048ccce4d8d8b8bb9f
Signed-off-by: Balaji Varadaraju <bvaradar@brocade.com>
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
8 years agoIntroduce lifecycle to runtime beans registrator in config-manager 15/32315/2
Maros Marsalek [Sat, 9 Jan 2016 13:44:59 +0000 (14:44 +0100)]
Introduce lifecycle to runtime beans registrator in config-manager

Root runtime bean registrator was not properly closed or reused
during reconfiguration.

Change-Id: I537f7af5957496001f51663ded206a4ab04e5401
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
8 years agoBUG-4514: clean children in InternalJMXRegistrator 77/32277/3
Robert Varga [Tue, 22 Dec 2015 18:44:27 +0000 (19:44 +0100)]
BUG-4514: clean children in InternalJMXRegistrator

Retaining children once they have been closed can lead to a leak, make
sure we call back to parent to remove ourselves from its list.

This includes a refactor to hide InternalJMXRegistrator, which becomes
abstract and has two subclasses: Root and Nested. This allows us to use
proper synchronization between closing of the child and parent
registrators. Also saves a bit of memory.

Also clean up {Module,Transaction}JMXRegistrator constructors to not do
a createChild(), as that fails to cleanup immediate children of the
Root, leading to empty InternalJMXRegistrators being collected in Root's
child list.

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

8 years agoBug 2062 - StreamWriter APIs loses information about leaf-set ordering 36/32236/4
Jan Hajnar [Mon, 10 Nov 2014 15:16:57 +0000 (16:16 +0100)]
Bug 2062 - StreamWriter APIs loses information about leaf-set ordering

* modified clustering NormalizedNodeStreamWriter implementation to use
OrderedLeafSet

Change-Id: I663f6b6d894b8366b7a54a3c56be05f20fef43c2
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
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>