controller.git
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>
8 years agoBackport mvn archetypes to stable/lithium. 05/24705/3
Jan-Simon Möller [Fri, 31 Jul 2015 19:22:46 +0000 (21:22 +0200)]
Backport mvn archetypes to stable/lithium.

Based on commits to master from
Ed Warnicke <hagbard@gmail.com>

v2: imported 24728 - whitespace fixes.

Change-Id: I4da6a343fab5d3072e7dec224da01a9a830e214a
Signed-off-by: Jan-Simon Moeller <dl9pf@gmx.de>
8 years agoFix akka logging initialization timeout on startup 80/24880/1
Tom Pantelis [Wed, 5 Aug 2015 22:57:22 +0000 (18:57 -0400)]
Fix akka logging initialization timeout on startup

We've seen CDS internittently failing to startup b/c akka fails to
initialize its logging system - it times out after 5 sec. It seems
on startup threads may be busy enough to prevent akka's message
to inialize the logging actor to timeout. Interestingly, We're only
seeing this on RedHat. The timeout is configured via
logger-startup-timeout which defaults to 5 sec. Increasing it fixes
the issue. I made it really high, 5 min, since if it times out we're
dead in the water anyway.

Change-Id: Ic95d7298b9320f03f664e9f2b171f980546ca95d
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBUG 2185 : Make the Custom Raft Policy externally configurable 68/24368/6
Moiz Raja [Wed, 22 Jul 2015 02:11:10 +0000 (19:11 -0700)]
BUG 2185 : Make the Custom Raft Policy externally configurable

A class which implements RaftPolicy needs to be set
to customize the behavior. I am hoping that this will be a barrier
to people unintentionally breaking the default raft policy as
they would need to know the internals of clustering in order to
supply a valid class.

I added two configurable raft policy classes for the two known
use cases,

- org.opendaylight.controller.cluster.datastore.policy.TestOnlyRaftPolicy
- org.opendaylight.controller.cluster.datastore.policy.TwoNodeClusterRaftPolicy.

Change-Id: Ic3cc2f27754c37e85c3be8a863764fc88ec84399
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoBUG 2185 : Introduce RaftPolicy & DefaultRaftPolicy 63/24363/8
Moiz Raja [Tue, 21 Jul 2015 23:42:47 +0000 (16:42 -0700)]
BUG 2185 : Introduce RaftPolicy & DefaultRaftPolicy

These allow for simple customization of the Raft algorithm. The intention is
to support the 2-Node clustering scenario in which leaders for a Shard will need
to be specified externally and where weak(er) consistency may be considered ok

Change-Id: I16bc69a67ac3096082324f11e62565a7b9d7cc57
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoFix AppendEntry logic when prevLogIndex and prevLogTerm is -1 60/24360/4
Moiz Raja [Mon, 13 Jul 2015 20:31:42 +0000 (13:31 -0700)]
Fix AppendEntry logic when prevLogIndex and prevLogTerm is -1

When an AppendEntry arrives at a Follower with the prevLogIndex and
prevLogTerm = -1 the Follower will accept that append entry and add it
to the log. For a newly started Follower this can be problematic
because this will be the first entry in that Followers log and so
applying this entry to the Follower's state can end up corrupting the
state or cause failures in committing transactions.

To fix this we now verify if the replicatedToAllIndex is present in the
Followers log. If it is present then the log is considered in sync else
not.

Change-Id: I09bead430f1a4556182263de54846792668cd27c
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoCLEANUP : Fix javadoc warnings in sal-akka-raft code 65/24365/3
Moiz Raja [Wed, 22 Jul 2015 00:23:19 +0000 (17:23 -0700)]
CLEANUP : Fix javadoc warnings in sal-akka-raft code

Change-Id: Id26cdcac3c4bc7f998483e4078cd1891d0783e8d
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoDrop executable bit from odl.java.security 05/23405/2
Robert Varga [Thu, 25 Jun 2015 18:07:55 +0000 (20:07 +0200)]
Drop executable bit from odl.java.security

This is a plaintext file, it should not be executable

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

8 years agoBug 3887 - Autogenerated API documentation doesn't show application/xml 35/23635/2
Jan Hajnar [Wed, 1 Jul 2015 09:03:44 +0000 (11:03 +0200)]
Bug 3887 - Autogenerated API documentation doesn't show application/xml
as an option for RPC operations

* added xml input option for rpcs, put and post methods

Change-Id: I1f73bcb7d1127e4b4324d779aec40907ca627073
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
8 years agoBUG-3878 Prevent null pointer in nc for unresolved addresses 97/24097/2
Maros Marsalek [Tue, 14 Jul 2015 11:27:23 +0000 (13:27 +0200)]
BUG-3878 Prevent null pointer in nc for unresolved addresses

Unresolved address is not a reason for config pusher failure. Use host string
instead of resolved address string representation.

Change-Id: Ieba345077860cd55325ca49980c3fb9edd66051c
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
8 years agoBug 3999: Create internal service to access restconf 56/23856/9
Tom Pantelis [Tue, 7 Jul 2015 15:07:31 +0000 (11:07 -0400)]
Bug 3999: Create internal service to access restconf

There are use cases for invoking restconf from internal code. However
issuing an HTTP request is problematic as one would need to know the
credentials and scheme (http or https).

So I added a JSONRestconfService interface and implementation with CRUD
methods that call the JSON readers/writers and RestconfImpl internally.
The implementation is advertised as an OSGi service via the config
system for consumption by clients.

I only added a service for JSON - an XML service could be added as well
later.

Change-Id: I5d1304c568c9be9c204afea68aadc0306bac50b3
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoCDS: Changes to Tx abort in Shard 42/23742/8
Tom Pantelis [Wed, 1 Jul 2015 22:59:51 +0000 (18:59 -0400)]
CDS: Changes to Tx abort in Shard

I noticed when a tx times out on the front-end during CAN_COMMIT, it
tries to abort the tx but it may not get aborted in the Shard and the
front-end gets an AskTimeoutEx on the abort. The reason is that the
Shard only processes the abort request if the tx is the current tx being
committed. If it isn't, the request is ignored and no response is sent,
resulting in the front-end timeout.

I think it makes sense to also process the abort if the tx is sitting in
the queue awaiting CAN_COMMIT. If the front-end says to abort for any
reason, the Shard should honor it. Also, if it isn't aborted, the Shard
may dequeue it sometime later and attempt to commit it which can lead to
unpredictable results if prior commits failed.

As per the comments in the Helium patch, I did some re-factoring to make
it a bit cleaner. I moved the abort code from the Shard to the
ShardCommitCoordinator. This makes it consistent with the other tx
phases where the Shard mostly delegates to the ShardCommitCoordinator. I
also removed the getCohort method from CohortEntry and added appropriate
methods so the internal cohort instance isn't exposed.

There's more refactoring/cleanup that can be done re: Futures and also
moving CohortEntry into its own class (it's large enough) but I don't
want to overload this patch.

Change-Id: I73c79a5e4a2b39b7ee4d97a011de2d29b050dbc4
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoCDS: Retry remote front-end transactions on AskTimeoutException 51/23651/13
Tom Pantelis [Wed, 1 Jul 2015 20:28:43 +0000 (16:28 -0400)]
CDS: Retry remote front-end transactions on AskTimeoutException

With the front-end PrimaryShardInfo cache, if the cached primary/leader
shard is remote and unavailable, the RemoteTransactionContextSupport
will fail with an AskTimeoutException when it tries to send the
CreateTransaction message. Since it can take at least 1 election timeout
period to re-elect a new leader, I changed RemoteTransactionContextSupport
to also retry on AskTimeoutException (it already retries on
NoShardLeaderException). However instead of re-sending the
CreateTransaction message, as it did before, it now re-sends the
FindPrimary message to get a new primary shard actor.

I also modified how RemoteTransactionContextSupport retries. It will now
retry for a total period of 2 times the shard election timeout which
should be ample time for a re-election to occur. If no leader is found then
the txn will fail.

I also added a ShardLeaderNotRespondingException which the
RemoteTransactionContextSupport will throw if it ends up with an
AskTimeoutException after the tx creation timeout period. This shouldn't
occur normally as, with the retries, it should get a NoShardLeaderException
even if the initial error was AskTimeoutException. But it's possible to
end up with an AskTimeoutException, eg if the system is overloaded and
the election timeout is delayed.

During testing, I noticed that if you take down the 2 followers and try
a transaction, it fails with an AskTimeoutEx instead of
NoShardLeaderException as one would expect. This is b/c the leader
changes to an isolated leader. So I changed the Shardanager to return
NoShardLeaderException if the state is IsolatedLeader.

Change-Id: I3efd3f841cf41b7738aedb694fa18b44851b3074
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoCDS: Real snapshot log trimming changes 84/23984/4
Tom Pantelis [Fri, 10 Jul 2015 12:30:11 +0000 (08:30 -0400)]
CDS: Real snapshot log trimming changes

Bug 2692 changed real snapshotting to trim the in-memory log based on
the current replicatedToAllIndex for the normal case when all follower's
are up and "fake" snapshotting is advancing replicatedToAllIndex.

When a follower is down, real snapshots don't trim the log b/c
replicatedToAllIndex isn't advancing unless the memory threshold is
exceeded. So it will let the in-memory log keep growing past the
snapshot batch count. This sort of defeats the purpose of snapshotting,
ie to keep the journal size in check both on disk and in memory. It's
also a bit dangerous - it can chew up a lot of memory and starve the
rest of the system and cause large STW GC's once the follower comes
back up and the log is cleared. This can also cause multiple snapshots
in the follower once it comes back and catches up - eg, if it's behind
60K entries, it will snapshot after each 20K batch in quick succession.

To alleviate the potential excessive memory growth, in addition to
trimming the log from the captured lastAppliedIndex if the log memory
size threshold is exceeded, I changed the code to do the same if the log
size exceeds the snapshot batch count. So if a follower is down long
enough to exceed the snapshot batch count, the leader will install a
single snapshot to catch up the follower. Otherwise, the follower will
be caught up via AppendEntries.

I also noticed that if snapshot tries happen in quick succession, a
second attempt may be tried prematurely while the previous one is in
the PERSISTING state. This is b/c isCapturing() returns false in the
PERSISTING state. The state machine prevents another capture from
actually initiating b/c only the IDLE state implements capture but I
think to be clean we should disallow it by returning true from
isCapturing() in the PERSISTING state. This avoids state violations
during valid workflows (it's not invalid to attempt a capture while
another is in progress). Therefore, since every state now returns true
for isCapturing() except IDLE, I made true the default in
AbstractSnapshotState so only IDLE overrides it.

I added more end-to-end test cases to
ReplicationAndSnapshotsWithLaggingFollowerIntegrationTest to cover
leader snapshots where the log size exceeds the snapshotBatchCount,
where the memory threshold is exceeded and where neither of the first
2 conditions are met and the log is effectively not trimmed. The former
2 cases trim the log to last applied and result in a snapshot installed on
the follower once it's resumed. The latter case results in the leader
catching up the follower via AppendEntries.

Change-Id: Iaec9ba94232a17d6fa7b192c31c431b328e3d22e
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoCDS: Add pending tx queue size to ShardStats 13/23713/2
Tom Pantelis [Wed, 1 Jul 2015 20:58:28 +0000 (16:58 -0400)]
CDS: Add pending tx queue size to ShardStats

To aid debugging, I added the pending commit queue size of the
ShardCommitCoordinator to the ShardStats bean.

Change-Id: I2af3493eb5dd54f9f9406b0a005d66be004c12ff
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 3195: Cleanup on error paths and error handling 56/22656/8
Tom Pantelis [Mon, 15 Jun 2015 23:38:06 +0000 (19:38 -0400)]
Bug 3195: Cleanup on error paths and error handling

Modified ShardCommitCoordinator#handleBatchedModifications to remove the
cohortEntry from the cache if the total messages sent doesn't match the
total received.

With recent yangtools changes, write and merge on a DOM tx can throw
unchecked exceptions if he data is invalid. Modified the front-end
local tx path to catch unchecked exceptions in LocalTransactionContext
and propagate to the LocalThreePhaseCommit to immediately fail the
ready.

Similarly modified ShardCommitCoordinator#handleBatchedModifications to
handle unchecked exceptions from applied operations and propagate when
the tx is readied.

Added unit tests to cover these cases.

Also, modified LocalTransactionContext#readyTransaction to handle
unchecked exceptions from the DOM tx ready.

Change-Id: Ib6fe6e04b8626bf996cfabfe74da780f05ce838a
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoCDS: Change operationTimeout units to millis 10/23710/2
Tom Pantelis [Wed, 1 Jul 2015 20:21:35 +0000 (16:21 -0400)]
CDS: Change operationTimeout units to millis

For upcoming changes, I'll need to be able to set the operationTimeout
in millis for unit tests.

Change-Id: I7463a9b2e20db2b678e23a94cafd768db3ac099e
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBUG-3861 Detect RPC errors when committing netconf transaction 68/23268/4
Maros Marsalek [Thu, 25 Jun 2015 12:45:23 +0000 (14:45 +0200)]
BUG-3861 Detect RPC errors when committing netconf transaction

Transaction from netconf southbound would return a succeeded future in case
an rpc-error was returned as response to commit rpc.

Change-Id: I7ec538f09c5d1b9ac5e18d69ccc6d2c3939d01c3
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
8 years agoMake leafrefFromLeafListToLeafTest impervious to list order 44/23044/2
Tom Pantelis [Sat, 20 Jun 2015 09:06:56 +0000 (05:06 -0400)]
Make leafrefFromLeafListToLeafTest impervious to list order

In NnToJsonLeafrefType#leafrefFromLeafListToLeafTest, the leaf list is
unordered but the regex expects a certain order based on the way the
list is currently hashed. But this makes it susceptible to failure if
something changes upstream to alter the order. So I changed the regex to
not depend on the order.

Note: an upcoming yang tools patch will alter the order as a side effect
that affects this test.

Change-Id: Ibf95271b008134c3f75fc99c9ee7ba0d643dfe7a
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoUse AsyncAppender in pax-logging 11/23411/3
Robert Varga [Fri, 26 Jun 2015 10:37:15 +0000 (12:37 +0200)]
Use AsyncAppender in pax-logging

Using an async appender throughput of the logger, lowering its impact on
overall system performance. Testing with BGP debugging enabled, the
overall time to complete for 100K routes went down from 137 seconds to
81 seconds.

Change-Id: Ieac46ecbddb701f862f7d58833ebdc94de0fbaf4
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoFix features-netconf-connector not being included 09/23109/2
Robert Varga [Mon, 22 Jun 2015 15:27:31 +0000 (17:27 +0200)]
Fix features-netconf-connector not being included

mdsal-artifacts should be listing the features it needs, so users can
pick up their versions. This was not true for
features-netconf-connector.

Change-Id: I4d53d8cf3d6ff1bce57e9de223126fea5269419d
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBug 3800 - Fix usage of global SimpleDateFormat 93/22993/5
Vaclav Demcak [Fri, 19 Jun 2015 13:11:15 +0000 (15:11 +0200)]
Bug 3800 - Fix usage of global SimpleDateFormat

* fix usage of thread-safe SimpleDateFormater

Change-Id: I445739c22ecc8da9e5b9c51687fa6077f914de30
Signed-off-by: Vaclav Demcak <vdemcak@cisco.com>
8 years agoRe-enable tests and bump aaa version 86/23386/1
Thanh Ha [Thu, 25 Jun 2015 22:14:24 +0000 (18:14 -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.1.3-Helium-SR2
* to 0.1.4-SNAPSHOT.
* Re-enables the feature tests for the restconf and netconf-conector
  features.

Change-Id: I3a85ac10637d818126ff2543e3e39b22f36ecfea
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoBumping versions by 0.0.1 for next dev cycle 93/23293/2
Thanh Ha [Thu, 25 Jun 2015 18:27:46 +0000 (14:27 -0400)]
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.0-Lithium 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.1-SNAPSHOT) wiil update aaa.version and re-enable these tests.

Change-Id: I7ba0b8c6ced378b7bf6e490884b50ea9e26544b4
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoRelease Lithium 92/23292/1 release/lithium
Thanh Ha [Thu, 25 Jun 2015 18:26:57 +0000 (14:26 -0400)]
Release Lithium

Change-Id: I616543755330301c367cc59005b6d562aa31f953
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
8 years agoRemove commons-io dependency in netconf-ssh 84/21784/5
Tomas Cere [Wed, 3 Jun 2015 14:22:00 +0000 (16:22 +0200)]
Remove commons-io dependency in netconf-ssh

Remove the replacement of File separators in key path,
windows can handle linux style paths, added a warning to config to use linux style paths.

Change-Id: I01d07fa65cd11dcc321cbf4d6f5aac0792922309
Signed-off-by: Tomas Cere <tcere@cisco.com>
8 years agoBUG 2839: Config: remove dependencies on commons-io 70/21770/7
Tomas Cere [Tue, 2 Jun 2015 14:36:57 +0000 (16:36 +0200)]
BUG 2839: Config: remove dependencies on commons-io

Migrated commons-io users to guava and
custom solutions when there were no alternatives in guava.

Change-Id: I399030df1fbd7ea6e40b2591346802068e32f681
Signed-off-by: Tomas Cere <tcere@cisco.com>
8 years agoBug 3782: Fix NPE in API doc explorer 50/22850/1
Tom Pantelis [Tue, 16 Jun 2015 21:15:51 +0000 (17:15 -0400)]
Bug 3782: Fix NPE in API doc explorer

Fixed NPE when a netconf mounted device has a yang file without a version.

Change-Id: Ie562c05772ecd5e9c7d82afc31d06aaf852308a5
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years ago[RFC][Fix] Fix for connection in pom.xml. 13/22713/2
Jan-Simon Möller [Wed, 3 Jun 2015 13:41:22 +0000 (15:41 +0200)]
[RFC][Fix] Fix for connection in pom.xml.

The connection value was wrong.
Apply values proposed by zxiiro.

Also fix sal-dom-xsql (wrong developerConnection).

This allows me to run  mvn site
w/o failing due to the wrong entry.

Change-Id: I15d953647a40dde4b37246a78bae120552efb15b
Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
(cherry picked from commit 5197d588dac65f2345cbcba2e5aefae308fcf3a0)

8 years agoBug 3650 - Can not invoke zero argument RPC 73/22573/5
Vaclav Demcak [Wed, 17 Jun 2015 15:01:59 +0000 (17:01 +0200)]
Bug 3650 - Can not invoke zero argument RPC

Note: RpcDefinition hasn't any direct children. It contains
only INPUT and OUTPUT containters. But old functions have maped
RPC result automaticly without check exist OUTPUT ContanerSchemaNode.

* fix invokeRpc methods to rpcResponse OUTPUT processing.
* add tests for invokeRpc methods
* fix broken test from json.to.nn.test package

Change-Id: I39b8980156928d2011c0151eb798195d84614429
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
Signed-off-by: Vaclav Demcak <vdemcak@cisco.com>
8 years agoBUG-3625 Allow replace nested composite nodes in cfg-subsystem 87/22687/3
Maros Marsalek [Tue, 16 Jun 2015 11:36:30 +0000 (13:36 +0200)]
BUG-3625 Allow replace nested composite nodes in cfg-subsystem

Netconf-endpoint for config-subsystem now supports replace operation on nested
elements. Now it is possible to invoke PUT on nested composite attributes for
config-subsystem modules.

Change-Id: I5fde907c66c01a9c1bf58845daa868c7a141c998
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
8 years agoRevert "BUG-2679 Workaround for wrong nagasena encode/decode with reused transmogrifier" 82/22582/4
Tomas Cere [Tue, 16 Jun 2015 11:00:52 +0000 (13:00 +0200)]
Revert "BUG-2679 Workaround for wrong nagasena encode/decode with reused transmogrifier"

This reverts commit 8bedb6be52f21b52d6df08d1501cf46f8ddbdbdc.

Change-Id: I52d02ae6a980bae6798385636f9d779e3c80b72d
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Signed-off-by: Tomas Cere <tcere@cisco.com>
8 years agoBUG 2458: Bump nagasena version to 2.53.0 81/22681/3
Tomas Cere [Tue, 16 Jun 2015 10:36:21 +0000 (12:36 +0200)]
BUG 2458: Bump nagasena version to 2.53.0

Change-Id: I77e21237355cee3973a05a37981ab49a05018bf9
Signed-off-by: Tomas Cere <tcere@cisco.com>
8 years agoImprove performance of notification emitting in netconf testtool 11/22111/3
Maros Marsalek [Mon, 8 Jun 2015 15:22:45 +0000 (17:22 +0200)]
Improve performance of notification emitting in netconf testtool

- pre-parse all notifications beforehand
- remove unwanted outputs

Change-Id: I6dd823786fd0d5f9ab04943633f8aa3b61a540e8
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
8 years agoImprove performance of netconf notification processing 10/22110/3
Maros Marsalek [Mon, 8 Jun 2015 15:21:22 +0000 (17:21 +0200)]
Improve performance of netconf notification processing

Couple of minor performance fixes e.g:
- create QName without revision when not needed
- delete unnecessary logs
- parse event time using QName.parseRevision

Change-Id: Ic099e40fb5fdb7001af946e5f3e053911e54053f
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
8 years agoPrevent possible null pointer in netconf-connector's keepalives 88/22688/2
Maros Marsalek [Tue, 16 Jun 2015 12:09:32 +0000 (14:09 +0200)]
Prevent possible null pointer in netconf-connector's keepalives

Change-Id: If73a6eae2b11b3f4f3b37b0f5a022ebf5b9b18a8
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
8 years agoUse YangInstanceIdentifier.isEmpty() 26/22726/3
Robert Varga [Tue, 16 Jun 2015 19:52:14 +0000 (21:52 +0200)]
Use YangInstanceIdentifier.isEmpty()

Do not force instatiation of path arguments, emptiness can be checked
quickly using isEmpty() method.

Change-Id: I52f70309c5eb839a9532e499e681562fc4b95587
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoMake constants really constant 24/22724/5
Robert Varga [Tue, 16 Jun 2015 19:23:21 +0000 (21:23 +0200)]
Make constants really constant

This triggers a major sonar warning, and is insecure as these fields could
get modified by anyone, throwing the system out of whack.

Also optimize comparison and make sure the netconf QNameModule is cached.
Also prevent unneeded QName instantiation.
Also use an immutable list to hold arguments, preventing a copy in
builders.

Change-Id: I74647c444ec273066fc4727618b35c92386ba77c
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoUse correct boolean values for XML JSON tests. 97/22697/2
Tony Tkacik [Tue, 16 Jun 2015 14:18:08 +0000 (16:18 +0200)]
Use correct boolean values for XML JSON tests.

Change-Id: Ia608f4fdc885e94112e076bf669e67f5c136da03
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoMake sure DataTreeModifications are ready. 83/22683/1
Tony Tkacik [Tue, 16 Jun 2015 11:05:56 +0000 (13:05 +0200)]
Make sure DataTreeModifications are ready.

Change-Id: I1fa957d0f827f34187c4f22b7896581447159890
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoFix unit test failures 59/22659/3
Tom Pantelis [Tue, 16 Jun 2015 01:11:19 +0000 (21:11 -0400)]
Fix unit test failures

A couple tests in ShardTransactionTest are failing on jenkins builds:

java.lang.AssertionError: assertion failed: expected class
org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages$CommitTransactionReply,
found class akka.actor.Status$Failure
at scala.Predef$.assert(Predef.scala:179)
at
akka.testkit.TestKitBase$class.expectMsgClass_internal(TestKit.scala:424)
at
akka.testkit.TestKitBase$class.expectMsgClass(TestKit.scala:419)
at akka.testkit.TestKit.expectMsgClass(TestKit.scala:718)
at akka.testkit.JavaTestKit.expectMsgClass(JavaTestKit.java:408)
at
org.opendaylight.controller.cluster.datastore.ShardTransactionTest$14.<init>(ShardTransactionTest.java:474)
at
org.opendaylight.controller.cluster.datastore.ShardTransactionTest.testOnReceiveBatchedModificationsReadyWithImmediateCommit(ShardTransactionTest.java:454)

The tests use a "desc" leaf node but it's not defined in the test yang.
Nothing has changed in these tests so it appears there was a recent change
in yangtools to validate the node structure on put/merge.

I also fixed an intermittent timing failure in
PreLithiumShardTest#testHelium2VersionApplyStateLegacy that I see a
couple times.

Also, JsonToNnTest  has been failing on merge builds:

org.junit.ComparisonFailure: expected:<...me cont wasn't found[].> but
was:<...me cont wasn't found[ under
(urn:ietf:params:xml:ns:netconf:base:1.0)data].>
at org.junit.Assert.assertEquals(Assert.java:115)
at org.junit.Assert.assertEquals(Assert.java:144)
at
org.opendaylight.controller.sal.restconf.impl.json.to.nn.test.JsonToNnTest.incorrectTopLevelElementsTest(JsonToNnTest.java:129)

Apparently a change elsewhere added more text to the error message. I
changed the test to use the containsString matcher instead of exact
match.

Change-Id: I33ef71bce50ff39e26dcf2b443679c8eb34dd0dd
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 2358 - Remove tests cnsn to json and add tests nn to json 85/21185/7
Jakub Toth [Wed, 27 May 2015 09:41:45 +0000 (11:41 +0200)]
Bug 2358 - Remove tests cnsn to json and add tests nn to json

Tests of codecs are included in codecs yangtools yang-data-codec-gson and yang-data-impl but
we test codec on input data and also with presentation of Rest path.

* remove CnSnToJsonNotExistingLeafTypeTest.java test
* add NnToJsonNotExistingLeafTypeTest.java to nn/to/json/test/
  * test with not existing leaf type

Change-Id: Id7a1256b42a3a754e13343613dcad7059a2316c4
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoBug 2358 - Remove tests cnsn to json and add tests nn to json 91/21191/7
Jakub Toth [Wed, 27 May 2015 10:44:31 +0000 (12:44 +0200)]
Bug 2358 - Remove tests cnsn to json and add tests nn to json

Tests of codecs are included in codecs yangtools yang-data-codec-gson and yang-data-impl but
we test codec on input data and also with presentation of Rest path.

* remove CnSnToJsonWithAugmentTest test
* add NnToJsonWithAugmentTest to nn/to/json/test/
  * positive test for test augmented elements

Change-Id: I4c8b92e828ade1d43a5af5384ec7938854fda9ce
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoRemoved uncessary calls to RpcBroker to find routes. 76/22376/7
Tony Tkacik [Thu, 11 Jun 2015 15:19:46 +0000 (17:19 +0200)]
Removed uncessary calls to RpcBroker to find routes.

Moved invokeRpc part to RemoteRpcImplementation
which allowed to do ask for lookups in RemoteRpcImplementation.

This changed role of RpcBroker part to only delegate
to MD-SAL, if RPC was received via Akka.

remote.rpc.RpcBroker interaction model represented
multi-stepped pipeline which resulted in following
message pattern

RemoteRpcImplementaion ->
RpcBroker#InvokeRpc ->
RpcRegistry#FindRoutes ->
RpcBroker#ExecuteRpc

InvokeRpc only did lookup in FindRoutes and all
outgoing messages needed to pass via RpcBroker.
Unfortunatelly this also prevented lookup
of any RPC Path during executing RPC in MD-SAL.

Change-Id: I6e84bfcb74b71f7417c2d3f8c35a7f8b0406caf9
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoBug 2358 - Remove tests json to cnsn and add tests json to nn 20/19520/9
ary [Wed, 29 Apr 2015 10:09:41 +0000 (12:09 +0200)]
Bug 2358 - Remove tests json to cnsn and add tests json to nn

Tests of codecs are included in codecs yangtools yang-data-codec-gson and yang-data-impl but
we test codec on input data and also with presentation of Rest path.

* remove all tests json to composite node and simple node
* rewrite json leafref input tests from comp and simple node to normalized node
  * we're testing REST provider URI path translator with payload
* add test for test data in json with identityref to normalized node
  * positive test
  * test data in builded normalized node with data in json
    * used identityref type to reference an existing identity
* add test for test data in json with leafref to normalized node
  * positive test
  * test data in builded normalized node with data in json
    * used leafref type to reference particular leaf instance in the data tree
* add test for test data in json with more type of nodes and values
  * positive tests
    * test normalized node from json with:
      * simple data in list
      * simple data in container
      * multiple items in leaf-list
      * multiple items in list
      * empty leaf
      * augmented data
  * negative tests
    * test fail on bad top level elements
      * contains 3 situations
    * test fail for null data
      * empty leaf-list
      * leaf without any value
    * test on build normalized node with blank json
    * test fail with different namespaces
    * test fail because of unsupported format of json
    * test on invalid URI character

Change-Id: Icb5ff5d11843123c79859a0c75d7df7bad8a0b44
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoBug 868 - Continuous: remove deprecated APIs 71/22271/3
Jan Hajnar [Wed, 10 Jun 2015 11:55:42 +0000 (13:55 +0200)]
Bug 868 - Continuous: remove deprecated APIs

* removed deprecated API from Bug3595Test

Change-Id: Ic8f987aeb000cfb150286ad44e478771e8a52384
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
8 years agoBug 2358 - Remove tests cnsn to json and add tests nn to json 88/20888/7
Jakub Toth [Wed, 20 May 2015 21:34:52 +0000 (23:34 +0200)]
Bug 2358 - Remove tests cnsn to json and add tests nn to json

Tests of codecs are included in codecs yangtools yang-data-codec-gson and yang-data-impl but
we test codec on input data and also with presentation of Rest path.

* add test NnToJsonLeafrefType to nn/to/json/test
  * positive tests of leafref
    * absolut path
    * relative path
    * leafref to not leaf
    * from leaflist to leaf
    * from leafref to leafref
  * negative tests of leafref
    * non existing Leaf

Change-Id: I652204071d874d6c7a2a65e100dd68c16a12af8f
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoBug 2358 - Remove tests cnsn to json and add tests nn to json 10/20510/13
ary [Fri, 15 May 2015 13:25:08 +0000 (15:25 +0200)]
Bug 2358 - Remove tests cnsn to json and add tests nn to json

Tests of codecs are included in codecs yangtools yang-data-codec-gson and yang-data-impl but
we test codec on input data and also with presentation of Rest path.

* remove CnSnJsonChoiceCaseTest test
* add NnJsonChoiceCaseTest to nn/to/json/test/
  * positive and negative tests for choice statement

Change-Id: I83d351bf0de9bb4a1c649c5851209ae472aaaa24
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoBug 2358 - Fix resources for tests nn to json 71/21871/4
Jakub Toth [Thu, 4 Jun 2015 12:45:53 +0000 (14:45 +0200)]
Bug 2358 - Fix resources for tests nn to json

yang's namespace fix

Change-Id: I4b31cde6d9dc56b8298877b50c21a551c39f645f
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoBug 2358 - Remove tests cnsn to xml and add tests nn to xml 36/21536/5
Jakub Toth [Mon, 1 Jun 2015 08:53:53 +0000 (10:53 +0200)]
Bug 2358 - Remove tests cnsn to xml and add tests nn to xml

Tests of codecs are included in codecs yangtools yang-data-codec-gson and yang-data-impl but
we test codec on input data and also with presentation of Rest path.

* remove CnSnToXmlWithDataFromSeveralModulesTest test
* add NnToXmlWithDataFromSeveralModulesTest to nn/to/xml/test/
  * positive test for test more modules

Change-Id: I4f4eea89487e946b0a4a7edd75423d6bf551bd20
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoBug 2358 - Remove tests cnsn to xml and add tests nn to xml 27/21527/5
Jakub Toth [Mon, 1 Jun 2015 07:34:50 +0000 (09:34 +0200)]
Bug 2358 - Remove tests cnsn to xml and add tests nn to xml

Tests of codecs are included in codecs yangtools yang-data-codec-gson and yang-data-impl but
we test codec on input data and also with presentation of Rest path.

* remove CnSnInstanceIdentifierToXmlTest test
* add NnInstanceIdentifierToXmlTest to nn/to/xml/test/
  * positive test for instance identifier

Change-Id: Iceb73ed4d96f7686fca04047524716532297a2f8
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoBug 2358 - Remove tests cnsn to xml and add tests nn to xml 30/21530/5
Jakub Toth [Mon, 1 Jun 2015 08:15:54 +0000 (10:15 +0200)]
Bug 2358 - Remove tests cnsn to xml and add tests nn to xml

Tests of codecs are included in codecs yangtools yang-data-codec-gson and yang-data-impl but
we test codec on input data and also with presentation of Rest path.

* remove CnSnToXmlTest test
* add NnToXmlTest to nn/to/xml/test/
  * positive tests for basic data types

Change-Id: Iac408dc8ce25c8d9c46a21863733b30390ea8c34
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoBug 2358 - Remove tests cnsn to xml and add tests nn to xml 32/21532/5
Jakub Toth [Mon, 1 Jun 2015 08:33:58 +0000 (10:33 +0200)]
Bug 2358 - Remove tests cnsn to xml and add tests nn to xml

Tests of codecs are included in codecs yangtools yang-data-codec-gson and yang-data-impl but
we test codec on input data and also with presentation of Rest path.

* remove CnSnToXmlWithChoiceTest test
* add NnToXmlWithChoiceTest to nn/to/xml/test/
  * positive test for choice statement

Change-Id: Ie3fba1c51db57ef7621703812f7a98b6d417feca
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoBug 2358 - Remove tests cnsn to xml and add tests nn to xml 31/21531/5
Jakub Toth [Mon, 1 Jun 2015 08:24:40 +0000 (10:24 +0200)]
Bug 2358 - Remove tests cnsn to xml and add tests nn to xml

Tests of codecs are included in codecs yangtools yang-data-codec-gson and yang-data-impl but
we test codec on input data and also with presentation of Rest path.

* remove CnSnToXmlNotExistingLeafTypeTest test
* add NnToXmlNotExistingLeafTypeTest to nn/to/xml/test/
  * negative test for not existing leaf type

Change-Id: I6f55fd82c40a03726aecb78cfc2ece9888cf9717
Signed-off-by: Jakub Toth <jatoth@cisco.com>
8 years agoBUG-3552 Introduce custom java.security config file 61/22261/4
Maros Marsalek [Wed, 10 Jun 2015 08:30:29 +0000 (10:30 +0200)]
BUG-3552 Introduce custom java.security config file

Set the list of excluded ciphers available for use in ODL. The list was
developed in order to disable weak/vulnerable ciphers and also to prevent
the Logjam exploit.

The security file can be set using ODL_JAVA_SECURITY_PROPERTIES env variable.

Change-Id: I4867fe05986c020e09938c138d4d033299e0f9b7
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
8 years agoBUG 2970 : Recovery fails with SchemaValidationException when removing modules 29/22429/5
Moiz Raja [Fri, 12 Jun 2015 01:29:07 +0000 (18:29 -0700)]
BUG 2970 : Recovery fails with SchemaValidationException when removing modules

My prior fixes for bug 2970 did not address the recovery problem when a module is
removed but it's data is still present in the persisted files. This patch attempts
to address that.

There seems to be no schema validation when you write a normalized node at / so
for when writing or merging at / the pruning is done first before attempting a
write on InMemoryDataTreeModification

Also removed all unneccessary code.

Change-Id: Id2793330441606c62dfd903cdd698c2f86b14c1b
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoBUG 3652 : GZip restconf response 17/22317/3
Moiz Raja [Thu, 11 Jun 2015 01:10:07 +0000 (18:10 -0700)]
BUG 3652 : GZip restconf response

Change-Id: I15161eb011185b3e477484ad15b90a701a2e08e7
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoChange variables, methods, field names from transactionContextAdapter to transactionC... 04/22304/4
Moiz Raja [Wed, 10 Jun 2015 18:33:00 +0000 (11:33 -0700)]
Change variables, methods, field names from transactionContextAdapter to transactionContextWrapper

Change-Id: I675df3d3c5ace1fcb4b82025e862eafa8cc37357
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoBUG-3675 Support non-prefixed identityrefs in config subsystem 74/22374/3
Maros Marsalek [Thu, 11 Jun 2015 14:39:29 +0000 (16:39 +0200)]
BUG-3675 Support non-prefixed identityrefs in config subsystem

If a non prefixed but valid identityref was submitted as e.g. service type,
netconf connector for config subsystem failed.

Change-Id: I59dbb7dc83da9558db06118bdf1296f1ab9d782f
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
8 years agoBUG 3019 : Fix Operation throttling for modification batching scenarios 44/22244/9
Moiz Raja [Wed, 10 Jun 2015 01:37:35 +0000 (18:37 -0700)]
BUG 3019 : Fix Operation throttling for modification batching scenarios

This patch straightens out where exactly limiting is done.

A TransactionProxy creates a TransactionContext for every shard on
which a transaction needs to be done. There are 3 types of TransactionContexts.
NoOpTransactionContext, LocalTransactionContext and RemoteTransactionContext.
When a operation is done on TransactionProxy it does not know which of these
TransactionContexts it should create so it first createas a TransactionContextWrapper.
All operations on TransactionProxy are then queued up in the TransactionContextWrapper
till we determine which TransactionContext to create. This patch creates an
OperationLimiter per TransactionContextWrapper. Everytime an operation is enqueued
we acquire a permit.

When the TransactionContext is finally created we do different things depending on
the TransactionContext. For NoOp and Local TransactionContexts we completely ignore
the limiter - that is for these TransactionContexts there is no limiting done. For
RemoteTransactionContext we do limiting. RemoteTransactionContext does not acquire
Operation permits till it is made visible by the TransactionContextWrapper - this is
signaled be the setting of the handOffComplete flag in AbstractTransactionContext.
After that RemoteTransactionContext takes over the business of acquiring permits.
OperationLimiter which also serves as the Operation completion handler is the only
component that releases the permits.

Another thing which this patch addresses is which configuration option we use for
operation limiting. We now use ShardBatchedModificationCount instead of the mailbox
limit from akka.conf. This removes the possibility of mis-configuration where
making ShardedBatchedModificationCount higher than mailbox limit could cause
unexpected blocking.

Change-Id: I571ba5278630e5166be6bcb3ff8e1c527c5e3343
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoBug 3570: Use SnapShot lastAppliedIndex for install snapshot 85/22285/4
Tom Pantelis [Wed, 10 Jun 2015 06:17:21 +0000 (02:17 -0400)]
Bug 3570: Use SnapShot lastAppliedIndex for install snapshot

Follow-up patch for https://git.opendaylight.org/gerrit/#/c/21904/ to
use the captured Snapshot's lastAppliedIndex for the lastIncludedIndex
field in the InstallSnapshot message and the follower's matchIndex/nextIndex
once the install completes. This is in lieu of using the leader's snapshotIndex
which typically lags behind the lastAppliedIndex by 1 due to the trimming of
the in-memory log. This avoids the leader sending its last log entry
redundantly after the install completes as the last entry was included
in the snapshot.

Change-Id: Ie821078b4316641b67e1b853b9264353dde6bfae
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoFix NetconfMessageTransformerTest 09/22309/1
Moiz Raja [Wed, 10 Jun 2015 22:36:45 +0000 (15:36 -0700)]
Fix NetconfMessageTransformerTest

It fails and breaks the build

Change-Id: I1d3bb2d47417f3cb6d6f7246cadc0cc479a5ff4f
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoBug 3595 - RESTCONF: GET operation on a node in a list, identified by 12/22112/2
Jan Hajnar [Mon, 8 Jun 2015 15:28:12 +0000 (17:28 +0200)]
Bug 3595 - RESTCONF: GET operation on a node in a list, identified by
leaf-ref fails.

* added referenced type resolution for leafrefs in ControllerContext

Change-Id: Ic38b77038feb786a46a8bdd069448f006418d7bf
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
8 years agoBUG 2155 - depth parameter in URI 75/21675/6
Jan Hajnar [Tue, 2 Jun 2015 15:47:08 +0000 (17:47 +0200)]
BUG 2155 - depth parameter in URI

* added interface RestconfNormalizedNodeWriter
* added two implementations of RestconfNormalizedNodeWriter,
RestconfDelegatingNormalizedNodeWriter just calls normalized node
writer from yangtools and DepthAwareNormalizedNodeWriter is writer
implementation tha checks depth
* added CutDataToCorrectDepthTest (randomly failing, needs to be checked
or removed for now)
* added condition to xml and json normalized node writers to create
depth aware normalized node writer id depth is specified in writer parameters

Change-Id: I922942e24cbe505c2803644c25acd755fe4dfae7
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
8 years agoBug 2153 - pretty printer 77/20877/8
Jan Hajnar [Thu, 21 May 2015 07:46:57 +0000 (09:46 +0200)]
Bug 2153 - pretty printer

NormalizedNodeJsonBodyWriter - added ability to create JsonWritter with
prettyPrint enabled
NormalizedNodeXmlBodyWriter - added IndentingXMLStreamWriter when
prettyPrint is enabled

NormalizedNodeContext - info about requirements on indentation (true |
false) was added

RestconfImpl - added pretty print parsing method and added pretty print
detection to GET methods and RPC call methods

Change-Id: I44cfa778279d67f7dc1bf1532cd7fc1087b492dc
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
8 years agoAdd a keepalive executor to controller config loopback connection. 34/21934/3
Maros Marsalek [Tue, 9 Jun 2015 11:19:47 +0000 (13:19 +0200)]
Add a keepalive executor to controller config loopback connection.

Change-Id: Id4b93df4eb59a19dea2d00b348db3dd4866338cb
Signed-off-by: Tomas Cere <tcere@cisco.com>
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
8 years agoBug 3570: Persist snapshot on follower ApplySnapshot 04/21904/7
Tom Pantelis [Tue, 9 Jun 2015 13:32:52 +0000 (09:32 -0400)]
Bug 3570: Persist snapshot on follower ApplySnapshot

When a leader installs a snapshot on a follower, the follower now
perists the snapshot.

Change-Id: I56e25aa80f335e41a992ddce084c84c2a345b03b
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 3020: Use leader version in LeaderStateChanged 03/21603/5
Tom Pantelis [Tue, 2 Jun 2015 01:30:59 +0000 (21:30 -0400)]
Bug 3020: Use leader version in LeaderStateChanged

Modified the ShardManager to store the leader's version obtained from the
LeaderStateChanged message in the ShardInformation and propagate to the
RemotePrimaryShardFound message in response to FindPrimary.

ActorContext#findPrimaryShardAsync sets the leader's version in the
PrimaryShardInfo based on the FindPrimary response. If the response is
LocalPrimaryShardFound, it sets it to CURRENT_VERSION, otherwise it sets
it from the RemotePrimaryShardFound response.

RemoteTransactionContextSupport#setPrimaryShard checks the leader's
version to determine if it can utilize the direct tx modification
preparation on the shard actor.

Change-Id: I1defe03dea27dfb652cdc1e0a02fa70c6e454035
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoRemote RPC Broker: Make Futures non-blocking. 19/22219/3
Tony Tkacik [Tue, 9 Jun 2015 16:59:16 +0000 (18:59 +0200)]
Remote RPC Broker: Make Futures non-blocking.

Change-Id: I06eedf5eea33458f88b3bad94afcc8c1d85a9c19
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
8 years agoBUG-3604 Ignore empty edits in netconf connector 59/22159/2
Maros Marsalek [Tue, 9 Jun 2015 08:15:35 +0000 (10:15 +0200)]
BUG-3604 Ignore empty edits in netconf connector

Ignore merge/put operation with data that result in an empty edit-config rpc.
Some netconf devices ignore it, but some dont and return errors.

This kind of merge is triggered e.g. by Restconf when trying to ensure parent
structure for top level list.

Change-Id: I8351be304f4e55e000eb7fe0da262549ec377459
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
8 years agoBug 3640 - RPC call error - impossible to call rpc 82/22182/4
Jan Hajnar [Tue, 9 Jun 2015 11:02:45 +0000 (13:02 +0200)]
Bug 3640 - RPC call error - impossible to call rpc

* disabled children search in post if request is rpc input
* fixed XmlNormalizedNodeBodyReader tests that were testing on wrong rpc
input data

Change-Id: I2602d34a4ab42169959b867acaffa988a11601f3
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
8 years agoAvoid ClassCastException in remote-rpc-connector 40/22140/2
Moiz Raja [Tue, 9 Jun 2015 02:22:28 +0000 (19:22 -0700)]
Avoid ClassCastException in remote-rpc-connector

Change-Id: Idc41c2d4409ac321bc47e48150c801166999ce17
Signed-off-by: Moiz Raja <moraja@cisco.com>
8 years agoMigrate to MoreObjects 40/22040/4
Robert Varga [Sat, 6 Jun 2015 19:45:12 +0000 (21:45 +0200)]
Migrate to MoreObjects

Objects is overloaded with JDK7, use the MoreObjects class.

Change-Id: I73f9ba24e990df8160b45b6fb0763a1b2ac231d6
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBUG-2838: Trim leading whitespaces from incoming NETCONF messages. 78/20878/5
Gwenael Lambrouin [Thu, 21 May 2015 13:32:35 +0000 (15:32 +0200)]
BUG-2838: Trim leading whitespaces from incoming NETCONF messages.

Some network devices (such as Cisco routers) send RPC replies with a leading
newline before the XML declaration. The OpenDaylight controller does not accept
those replies: the XML parsing fails.

This patch fixes the NETCONF messages before they are sent to the XML parser:
it removes all the spurious characters at the beginning of the messages.

Change-Id: Ibc6eb6dc5bad6252a3c9bed73d3db83814aff501
Signed-off-by: Gwenael Lambrouin <gwenael.lambrouin@b-com.com>
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
(cherry picked from commit eb3ebced9d3471644dece3e4e27cca9451db0685)

8 years agoSet revisions for notification models in netconf 09/22109/2
Maros Marsalek [Mon, 8 Jun 2015 15:20:40 +0000 (17:20 +0200)]
Set revisions for notification models in netconf

Change-Id: I83159f20250914c9e178b83dc526d9e9e14dce74
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
8 years agoBump maven-archetype plugin to 2.3 18/21518/3
Robert Varga [Sun, 31 May 2015 23:29:44 +0000 (01:29 +0200)]
Bump maven-archetype plugin to 2.3

This is a newer version, so make a central bump.

Change-Id: I512b2ec1db75db53e47e23458fa99724e22eef53
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoUnify declarations in archetype-parent 17/21517/4
Robert Varga [Sun, 31 May 2015 23:20:04 +0000 (01:20 +0200)]
Unify declarations in archetype-parent

Instead of repeating extends/pluginManagement sections, make sure they
are inherited from the parent.

Change-Id: I49882c57221a5c5806d936ff3b94cf71aeef64e6
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoMove operation limiter down to TransactionContextWrapper 55/20755/14
Robert Varga [Tue, 19 May 2015 20:04:10 +0000 (22:04 +0200)]
Move operation limiter down to TransactionContextWrapper

The limiter tracks the number of operations invoked on the shard leader,
which does not correspond to the number of operations executed on the
frontend.

The appropriate entity to decide what is throttled how is the
TransactionContext, which unfortunately may not exist. We will solve
this problem by making TransactionContextWrapper perform pessimistic
limiting as long as the context does not exist. Once the context is
materialized, the outstanding operation queue is handed off to it and
the context becomes the entity managing the limits.

This patch has the side-effect that committing a transaction requires
number of permits equal to the number of shards it touches. It also
ensures that readAll() is properly throttled.

Change-Id: If91816d806bbb3895592e1f42b0b8e389443d0f7
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoConvert OperationCompleter to OperationLimiter 54/20754/11
Robert Varga [Tue, 19 May 2015 19:50:12 +0000 (21:50 +0200)]
Convert OperationCompleter to OperationLimiter

The completer and limiter functions are related to each other, so
encapsulate them in a single object.

Since a TransactionProxy cannot really do anything without touching the
limiter, make sure we instantiate it in constructor, preventing some
volatile reads in the fast path.

Change-Id: I4cf31ef46c11676611a62db7a794f504712ce5af
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBug 3039 - PUT augmentNode like last path element 47/21847/4
Vaclav Demcak [Thu, 4 Jun 2015 16:13:48 +0000 (18:13 +0200)]
Bug 3039 - PUT augmentNode like last path element

* fixed JsonNormalizedNodeBodyReader error when PUT operation was used
and data were wrapped in augmentation or choice nodes
* fixed bug that allowed XmlNormalizedNodeBodyReader to parse PUT with
incorrect data (when PUT request was written as POST)

note: testet manualy describled scenario + CSIT OFP_test_suite

Change-Id: Ia25b6b45a1154866dea29c763be67cdb17fa0ce1
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
Signed-off-by: Vaclav Demcak <vdemcak@cisco.com>
8 years agoFix various netconf warnings 39/22039/2
Robert Varga [Sat, 6 Jun 2015 19:43:10 +0000 (21:43 +0200)]
Fix various netconf warnings

Overridden version, potentially static methods.

Change-Id: I54af7e8b48335b4b81594d4deeb0f75e21dbc932
Signed-off-by: Robert Varga <rovarga@cisco.com>
8 years agoBug 3020: Add leader version to LeaderStateChanged 84/19184/3
Tom Pantelis [Fri, 24 Apr 2015 22:26:22 +0000 (18:26 -0400)]
Bug 3020: Add leader version to LeaderStateChanged

Added the leader's payload version to the LeaderStateChanged message and
modified the raft code to set it.

Change-Id: I9a34f90641a2962418d234bb56e55f2df5207e5b
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoCheck total batched messages sent in ShardCommitCoordinator on tx ready 00/21500/3
Tom Pantelis [Sat, 30 May 2015 09:06:46 +0000 (05:06 -0400)]
Check total batched messages sent in ShardCommitCoordinator on tx ready

Added check in the ShardCommitCoordinator to ensure the total number of
batched messages sent equals the total number of messages received as
was done in the ShardWriteTransaction.

Change-Id: I86a67aec7a6a8e8994aee9a2a167972ede1808c7
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
8 years agoBug 3372: Convert backend DataTree exceptions appropriately 26/22026/2
Tom Pantelis [Sat, 6 Jun 2015 12:06:48 +0000 (08:06 -0400)]
Bug 3372: Convert backend DataTree exceptions appropriately

Specifically, convert ConflictingModificationAppliedException to
OptimisticLockFailedException and
DataValidationFailedException to TransactionCommitFailedException.

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