controller.git
7 years agoBUG-7783: increase precision of execution times 57/54957/4
Robert Varga [Wed, 12 Apr 2017 11:12:34 +0000 (13:12 +0200)]
BUG-7783: increase precision of execution times

Document the time units we are using for measuring execution
and make sure they can hold any long.

Change-Id: I859349e27604c75d426ad7c4eec9d6870b081291
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 20cffa6b2251167e428a641d18a49958044fe598)

7 years agoBUG-8205: use updated DatastoreContext 56/54956/3
Robert Varga [Wed, 12 Apr 2017 10:15:30 +0000 (12:15 +0200)]
BUG-8205: use updated DatastoreContext

DatastoreContext is updated by the config admin overlay, which means
we cannot refer to the initial one passed in when we are deciding
which data store to instantiate.

This fixes up the protocol propagation and adds and initial info about
which protocol is in use.

Change-Id: I3c2f1a5eec1c7346fff3aca2d85609f47990723a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit e325f9ec2d3fc6b059823d88658596be544a1828)

7 years agoMake AbstractIdentifiablePayloadTest public 04/54804/3
Tom Pantelis [Tue, 11 Apr 2017 17:24:01 +0000 (13:24 -0400)]
Make AbstractIdentifiablePayloadTest public

For some reason, tests derived from AbstractIdentifiablePayloadTest
fail b/c AbstractIdentifiablePayloadTest isn't public when running from
eclipse - runs fine from command line.

Change-Id: Ie6ed1d6e0e130a1ffc5ad04db93e037ea6a79549
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
7 years agoBug 8206: Prevent decr follower next index beyong -1 80/54780/6
Tom Pantelis [Tue, 11 Apr 2017 13:39:49 +0000 (09:39 -0400)]
Bug 8206: Prevent decr follower next index beyong -1

If a follower's next index is already -1, we shouldn't decrement it
further, ie -1 is the lowest allowed value. This can result in AbstractLeader
continuously decrementing and logging an info message while in the
process of sending an install snapshot.

member-3-shard-default-config (Leader): follower member-1-shard-default-config last log term 2 conflicts with the leader's 3 - dec next index to -2

Modified decrNextIndex to return a boolean if next index was decremented
which is checked  by AbstractLeader.

Change-Id: I29454d4e71a7f9128b3b47f6a4e3403615c2c8d2
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 years agoRemove akka-distributed-data-experimental 83/54983/3
Robert Varga [Thu, 13 Apr 2017 13:28:56 +0000 (15:28 +0200)]
Remove akka-distributed-data-experimental

This module was used during development, but we stopped using it,
remove it from dependencies.

Change-Id: I415347f4e8a264a0daf604375815728f3a77837a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 years agoFix intermittent failure in testWriteTransactionWithSingleShard 21/54821/3
Tom Pantelis [Wed, 12 Apr 2017 06:20:18 +0000 (02:20 -0400)]
Fix intermittent failure in testWriteTransactionWithSingleShard

DistributedDataStoreRemotingIntegrationTest.testWriteTransactionWithSingleShard
fails intermittently with tell-based protocol in verifyCars after it has
reinstated the follower where it's expecting just car1 but the
data tree contains car 1 and car2. This is b/c the delete transaction for car2
prior to reinstatement wasn't applied on recovery due to the corresponding
ApplyJournalEntries message missing from the persisted journal. The test
expects 2 ApplyJournalEntries messages to be persisted corresponding to the
2 transactions but tell-based persists other payloads as well so there may
be 3 ApplyJournalEntries messages. I changed the code to handle this case.

Also the assertion failure in verifyCars caused it to bypass shutting down
the ActorSystem which resulted in several other failures in tests that try to
use the same port configuration due to the port already in use. So I made
changes to ensure ActorSystems are shutdown properly.

Change-Id: Id6316d71fcd9eb3e768c6b1f676fa0e9be1287a2
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
7 years agoFix intermittent failures in FollowerTest 14/54814/2
Tom Pantelis [Tue, 11 Apr 2017 21:39:38 +0000 (17:39 -0400)]
Fix intermittent failures in FollowerTest

FollowerTest.testCaptureSnapshotOnLastEntryInAppendEntries:1152 Persisted journal entries size: [] expected:<1> but was:<0>

The test waits on the deletion of journal entries after the snapshot is saved
to occur and then checks the persistent journal for the remaining
ApplyJournalEntries. But occasionally the persisting of the ApplyJournalEntries
message occurs after the deletion so the assertion fails b/c the
ApplyJournalEntries wasn;t persisted yet. This is a little odd b/c the
sequencing in the raft code is that the ApplyJournalEntries write is done
before the delete so it should also be observed the same way in the
InMemoryJournal, even though it doesn't really matter either way.

To alleviate the problem I added a wait for the ApplyJournalEntries
message in the journal in the 3 similar tests.

I also made a couple other minor changes that I observed while running the
tests.

Change-Id: I67cbb8fd79c91cd1cc23c363b78e7f5e9b9f2bbe
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
7 years agoFix FindBugs error in DelayedListenerRegistration#getInstance 54/55054/1
Tom Pantelis [Fri, 14 Apr 2017 13:50:24 +0000 (09:50 -0400)]
Fix FindBugs error in DelayedListenerRegistration#getInstance

The ObjectRegistration interface was recently changed to annotate
getInstance with @Nonnull to promise it will not return a null.
However DelayedListenerRegistration could return null if the delegate
is not set yet. In reality, we do not and should not ever call this
method on DelayedListenerRegistration instances so I changed it to
throw UnsupportedOperationException to make it explicit and to avoid
the FindBugs error.

Change-Id: I9fe374b23336d8ade65b2f1b697d93f50a090df9
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
7 years agoBump versions by x.(y+1).z for next dev cycle 89/54689/1
Anil Belur [Tue, 11 Apr 2017 01:45:30 +0000 (11:45 +1000)]
Bump versions by x.(y+1).z for next dev cycle

Change-Id: Ife090ef2c9bb25e515b2fb06e2766c56d8174d76
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
7 years agoHandle odl-mdsal-common with Karaf 4.0.9 07/54607/1
Stephen Kitt [Mon, 10 Apr 2017 15:00:17 +0000 (17:00 +0200)]
Handle odl-mdsal-common with Karaf 4.0.9

Karaf 4.0.9 simplifies feature dependencies (so that dependencies
specified in feature.xml can be completed from the POM), but that
causes issues with odl-mdsal-common since features in Karaf are
identified by their name only:

* if both the controller odl-mdsal-common and the mdsal
  odl-mdsal-common are encountered in the dependency tree, whichever
  one came first (as dependencies are resolved) is the one that ends
  up being kept;
* in some circumstances, the mdsal repository replaces controller's
  even when the controller dependency is retained (this is a Karaf bug
  which I'll submit a patch for, but we can work around it).

Change-Id: I5400a829560ae96cb2f264e103020cccd1d225c3
Signed-off-by: Stephen Kitt <skitt@redhat.com>
7 years agoBUG-5280: add the concept of a recorded failure 71/54371/4
Robert Varga [Wed, 5 Apr 2017 16:36:48 +0000 (18:36 +0200)]
BUG-5280: add the concept of a recorded failure

This patch reworks LocalReadWriteProxyTransaction to be defensive
of its internal modification and introduces the concept of a delayed
recorded error (currently unused).

The defensiveness checks allow us to get rid of FailedDataTreeModification,
as we do not give out our modification at all in the codepaths which
would leak this implementation.

Change-Id: I5f91218ac308f7450a3b59252d44f953be54626c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 years agoBug 7805: Add make-leader-local rpc for module based shard. 00/54100/13
Tomas Cere [Thu, 30 Mar 2017 12:44:32 +0000 (14:44 +0200)]
Bug 7805: Add make-leader-local rpc for module based shard.

csit testing scenarios require movement of the shard leader for module
based shards aswell so add this into ClusterAdminRpcService.

Change-Id: Ib8a310cdba728c0a42d8850703740bf4698adbe0
Signed-off-by: Tomas Cere <tcere@cisco.com>
7 years agoBug 7806 - Implement agent RPCs for shard replica manipulation testing 38/54038/9
Tomas Cere [Wed, 29 Mar 2017 10:14:33 +0000 (12:14 +0200)]
Bug 7806 - Implement agent RPCs for shard replica manipulation testing

These can be implemented as a part of ClusterAdminRpcService instead
of creating new rpcs that would be part of the lowlevel suite.

Change-Id: I891f9d3703a9357e829159691cbf18f95523d529
Signed-off-by: Tomas Cere <tcere@cisco.com>
7 years agoBUG-5280: log a message when tell-based protocol is active 20/54320/2
Robert Varga [Tue, 4 Apr 2017 16:27:34 +0000 (18:27 +0200)]
BUG-5280: log a message when tell-based protocol is active

Discerning the two access modes is critical to understanding
when failures occur. Add an explicit note when the tell-based
protocol is enabled on a data store.

Change-Id: I3e2b1d2f84a73ce1a3759d419176c47a6dd0ad12
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 years agoPass no op callback instead of null during replay 22/54022/5
Andrej Mak [Wed, 29 Mar 2017 09:32:25 +0000 (11:32 +0200)]
Pass no op callback instead of null during replay

Change-Id: Ife964481dc225bbc1d5b312035384f8bd597d740
Signed-off-by: Andrej Mak <andrej.mak@pantheon.tech>
7 years agoAdd AbstractIdentifiablePayload unit tests 52/54252/3
Andrej Mak [Mon, 3 Apr 2017 09:01:04 +0000 (11:01 +0200)]
Add AbstractIdentifiablePayload unit tests

Change-Id: I884f3c35d1767ed02accabc3b9a775ef9c667716
Signed-off-by: Andrej Mak <andrej.mak@pantheon.tech>
7 years agoUnit test for ClientBackedTransaction derived classes 88/53988/21
Ivan Hrasko [Tue, 28 Mar 2017 15:21:21 +0000 (17:21 +0200)]
Unit test for ClientBackedTransaction derived classes

Change-Id: I2967a0e224fc783ffac73a994def666e86a423a6
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
7 years agoUnit tests for ClientBackedTransactionChain class 18/54018/10
Ivan Hrasko [Wed, 29 Mar 2017 08:53:23 +0000 (10:53 +0200)]
Unit tests for ClientBackedTransactionChain class

Change-Id: I97953cfdc32619c31295cfed2584b7466d48aa5d
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
7 years agoAbstractClientHistory derived classes tests 43/54043/17
matus.kubica [Wed, 29 Mar 2017 14:13:57 +0000 (16:13 +0200)]
AbstractClientHistory derived classes tests

Change-Id: I1261eb764c730bbce6eb833644db99e4bbf0605c
Signed-off-by: matus.kubica <matus.kubica@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
7 years agoAbstractDOMDataBroker fix annotations 02/54202/2
Jie Han [Sat, 1 Apr 2017 02:54:49 +0000 (10:54 +0800)]
AbstractDOMDataBroker fix annotations

Change-Id: I7938965d805ba3e4228e9fc5a36c75c52f6ec881
Signed-off-by: Jie Han <han.jie@zte.com.cn>
7 years agoBug 7805 - Implement agent RPCs for shard leader movement testing 01/53901/12
Tomas Cere [Mon, 27 Mar 2017 14:30:27 +0000 (16:30 +0200)]
Bug 7805 - Implement agent RPCs for shard leader movement testing

Change-Id: Ic19d1867f3c54ec22d600e9b80c6490d5a4b99bb
Signed-off-by: Tomas Cere <tcere@cisco.com>
7 years agoBUG-5280: Close client history after all histories are closed 37/54037/9
Ivan Hrasko [Wed, 29 Mar 2017 13:51:33 +0000 (15:51 +0200)]
BUG-5280: Close client history after all histories are closed

Make sure record history state as closed once we are done with
it.

Change-Id: Icbdf947ad166b082e06df896741e618e801ecf2e
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
7 years agoBUG-5280: switch tests to ClientBackedDataStore 18/48718/102
Robert Varga [Mon, 12 Dec 2016 18:34:38 +0000 (19:34 +0100)]
BUG-5280: switch tests to ClientBackedDataStore

Enable integration tests to run
on the new frontend code with parametrized JUNIT.

Not working tests for new code are ignored.
For old code all tests run and pass.

Change-Id: Ib5656ecd2333a56d5c466e633fbdd477accc4095
Signed-off-by: Robert Varga <rovarga@cisco.com>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
7 years agoBUG 7801: prevent OptimisticLockFailedExceptions in write-transactions. 84/53784/7
Tomas Cere [Fri, 24 Mar 2017 10:29:16 +0000 (11:29 +0100)]
BUG 7801: prevent OptimisticLockFailedExceptions in write-transactions.

When multiple instances of this rpc are running concurrently in paralel
we would run into an optimistic lock since every instance tries to write
the topmost parent list first.
When these happen handle these failures as expected and resume with the
next stage of the rpc.

Change-Id: I43efaea3315b04272113eb86733e68609e434984
Signed-off-by: Tomas Cere <tcere@cisco.com>
7 years agoBug 7803: Implement agent RPCs for data tree change listener testing 78/53278/13
Tomas Cere [Thu, 9 Mar 2017 13:12:45 +0000 (14:12 +0100)]
Bug 7803: Implement agent RPCs for data tree change listener testing

Change-Id: Id2d53d3765fb9d518d4b052792d716d2b2b4c976
Signed-off-by: Tomas Cere <tcere@cisco.com>
7 years agoBug 7804: Implement agent RPCs for DOMDataTreeListener testing 63/53563/13
Tomas Cere [Mon, 27 Mar 2017 11:17:11 +0000 (13:17 +0200)]
Bug 7804: Implement agent RPCs for DOMDataTreeListener testing

Change-Id: I9e57e169fc3151a12914b2f370e0c97f41395992
Signed-off-by: Tomas Cere <tcere@cisco.com>
7 years agoBUG 7802: split out shard creation from produce transactions 95/53895/10
Tomas Cere [Mon, 27 Mar 2017 11:16:41 +0000 (13:16 +0200)]
BUG 7802: split out shard creation from produce transactions

Change-Id: I33fa46791a6c80477f57badf3bd44c3d6c5a2f9e
Signed-off-by: Tomas Cere <tcere@cisco.com>
7 years agoBug 7802 : Implement agent RPCs for transaction producer testing 78/53478/13
Tomas Cere [Fri, 17 Mar 2017 09:40:38 +0000 (10:40 +0100)]
Bug 7802 : Implement agent RPCs for transaction producer testing

Change-Id: I56d89093bd292032f92cdc98f25056822d93e628
Signed-off-by: Tomas Cere <tcere@cisco.com>
7 years agoBug 7407 - CDS: allow applications to request Leader movement 43/53543/27
Jakub Morvay [Mon, 6 Mar 2017 12:54:31 +0000 (13:54 +0100)]
Bug 7407 - CDS: allow applications to request Leader movement

This patch provides the routing from cds-dom-api CDSShardAccess
to the backend RaftActor.

Change-Id: I9fa315034d95a1896393a6152147a7bc50829b2a
Signed-off-by: Jakub Morvay <jmorvay@cisco.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 years agoBug 7407 - Add request leadership functionality to shards 42/53542/21
Jakub Morvay [Mon, 20 Mar 2017 08:58:11 +0000 (09:58 +0100)]
Bug 7407 - Add request leadership functionality to shards

This adds a new MakeLeaderLocal message to Shard class API.
MakeLeaderLocal message is sent to a local shard replica to request
the shard leader to be moved to the local node. Local shard will
contact the current leader with RequestLeadership message to initiate
leadeship transfer to itself. Original sender of MakeLeaderLocal
message will be notified about result of this operation.

Change-Id: I2b0ee7caf772457e31250d1bdddd5fc77b16fc53
Signed-off-by: Jakub Morvay <jmorvay@cisco.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 years agoDOMDataBrokerTransactionChainImpl fix parameter name in annotation 01/54201/2
Jie Han [Sat, 1 Apr 2017 01:18:02 +0000 (09:18 +0800)]
DOMDataBrokerTransactionChainImpl fix parameter name in annotation

Change-Id: I8c229c57490f6d78fc46e6c2a7db745d9adc80ad
Signed-off-by: Jie Han <jeong_hyun@msn.com>
7 years agoClarify javadocs related to ProgressTracker 47/53147/3
Vratko Polak [Fri, 10 Mar 2017 15:17:15 +0000 (16:17 +0100)]
Clarify javadocs related to ProgressTracker

Change-Id: Ie208037ec2759d15c4eff86315389968e76c07bc
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
7 years agoBUG-5280: make sure we have metadata for standalone history 88/54088/3
Robert Varga [Thu, 30 Mar 2017 08:45:50 +0000 (10:45 +0200)]
BUG-5280: make sure we have metadata for standalone history

With metadata propagation in place, we get a ton of warnings
in the form of:

Unknown history for aborted transaction member-2-datastore-config-fe-0-txn-1261-0, ignoring

which is indicative of our failure to populate metadata builder
with the history for standalone transactions. This patch fixes
that and adds recovery for the case when we fail to find the
history in recovered journal.

Change-Id: I338666dbd910ec683a44a814deed7382eb255218
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 years agoBUG-5222: remove xsql from archetype 57/54157/2
Robert Varga [Fri, 31 Mar 2017 09:05:27 +0000 (11:05 +0200)]
BUG-5222: remove xsql from archetype

XSQL should not be here, kill it.

Change-Id: I68bafa8961598f3407763661c1c3a294c6209774
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 years agoBUG-2138: Create blueprint wiring for cds shard manager. 95/48795/59
Jakub Morvay [Fri, 3 Mar 2017 11:32:17 +0000 (12:32 +0100)]
BUG-2138: Create blueprint wiring for cds shard manager.

Change-Id: I504c294db111944c8e2047e58c3e1ef1aa81aee8
Signed-off-by: Jakub Morvay <jmorvay@cisco.com>
7 years agoBUG 2138 - Do not fail on module-based default shard 34/53734/14
Jakub Morvay [Thu, 23 Mar 2017 13:56:14 +0000 (14:56 +0100)]
BUG 2138 - Do not fail on module-based default shard

Currently, DistributedShardedDOMDataTree will try to create default
shards on its start. However, this can collide with module-based default
shards. If present in modules.conf, modules-based default shards will be
created on DistributedDatastore's start.

If already present, do no create default shards. Create just
DistributedShardFrontend for them.

Change-Id: I05857f520e3467116e8748e6ae231ab9dc39f44c
Signed-off-by: Jakub Morvay <jmorvay@cisco.com>
7 years agoBUG-7965 Switch distributed-data backend to a separate shard 09/50609/46
Tomas Cere [Tue, 10 Jan 2017 11:44:57 +0000 (12:44 +0100)]
BUG-7965 Switch distributed-data backend to a separate shard

The shard needs to be present on all nodes and replicated across
the cluster. Making this into shard allows us to leverage the current
datastore api's and also persistence so we have the sharding layout
persisted.

The shard is started on all nodes once DistributedShardedDOMDataTree is
created.

Change-Id: I697be9b7134a27720e23e3e56f9fddc71301ec1e
Signed-off-by: Tomas Cere <tcere@cisco.com>
7 years agoClosedTransactionException unit test 94/54094/1
matus.kubica [Thu, 30 Mar 2017 11:08:36 +0000 (13:08 +0200)]
ClosedTransactionException unit test

Change-Id: Ib86fe2e8e6ece0c5cc41efdcae02223cf94d362b
Signed-off-by: matus.kubica <matus.kubica@pantheon.tech>
7 years agoUnit tests for ClientBackedDataStore class 82/53982/4
Ivan Hrasko [Tue, 28 Mar 2017 13:56:44 +0000 (15:56 +0200)]
Unit tests for ClientBackedDataStore class

Change-Id: Ieba1004283905b82730b1ee23c2afeb4eb98f963
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
7 years agoFailedDataTreeModification JUnit test 01/53601/3
matus.kubica [Tue, 21 Mar 2017 11:35:40 +0000 (12:35 +0100)]
FailedDataTreeModification JUnit test

Change-Id: Icac1405b8a17ce18119fbefb55e71898dc90082f
Signed-off-by: matus.kubica <matus.kubica@pantheon.tech>
7 years agoBindingDOMRpcImplementationAdapter code clean-up 70/53970/3
Martin Ciglan [Tue, 28 Mar 2017 11:01:41 +0000 (13:01 +0200)]
BindingDOMRpcImplementationAdapter code clean-up

- warnings
- package-private access
- lambda expression
- typo
- white-spaces
- not used method parameter

Change-Id: I495e38037379f43553d723706ef87c1fb967aff6
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoBUG-5280: make sure we arm the request timer 00/53900/4
Robert Varga [Mon, 27 Mar 2017 14:19:25 +0000 (16:19 +0200)]
BUG-5280: make sure we arm the request timer

The timer which is supposed to timeout requests and detect
overall badness of the backeend was not being armed. Fix that
by scheduling it whenever we make the queue non-empty.

Change-Id: I9d8be694e3ed5154b66baca76c0788840a38c2f7
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoJUnit test for ModuleShardBackendResolver 96/53596/5
matus.kubica [Tue, 21 Mar 2017 10:38:11 +0000 (11:38 +0100)]
JUnit test for ModuleShardBackendResolver

Change-Id: I1fd7b77873d56f02eb024e27f2bcd4e42ff7c10d
Signed-off-by: matus.kubica <matus.kubica@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
7 years agoRework CDS commit cohort impl to handle yang lists 84/51584/11
Tom Pantelis [Wed, 8 Feb 2017 18:52:12 +0000 (13:52 -0500)]
Rework CDS commit cohort impl to handle yang lists

If a cohort registers for yang list entries, it works fine if the
transaction only contains a write or delete of one list entry.
However the DataTreeCohortActor throws an UnsupportedOperationException
from CohortBehaviour#handle if more then one list entry is written. In
that case multiple CanCommit messages are sent to the DataTreeCohortActor,
a DOMDataTreeCandidate for each entry, but the CohortBehaviour is set up
to only handle one message, after which it expects to transition to the
PostCanCommit step.

It seems the DOMDataTreeCommitCohort#canCommit API really should take
a collection of DOMDataTreeCandidates. Howeever in lieu of an API change,
I modified the CanCommit message to contain a collection of
DOMDataTreeCandidates. The DataTreeCohortActor invokes canCommit for
each one and uses the last PostCanCommitStep returned. This *may*
be OK although there doesn't seem to be an alternative at this point.
We probably should note this behavior in the DOMDataTreeCommitCohort
API.

Change-Id: I17c4d2f477ffc6c6c3921217e5f6c13bcdafde8f
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
7 years agoBUG-8056: make doCommit/finishCommit package-private 38/53738/2
Robert Varga [Thu, 23 Mar 2017 14:46:16 +0000 (15:46 +0100)]
BUG-8056: make doCommit/finishCommit package-private

This is not a complete fix for the issue, but it eliminates
the need for synthetic accessor methods:

at org.opendaylight.controller.cluster.datastore.ShardCommitCoordinator.doCommit(ShardCommitCoordinator.java:296)
at org.opendaylight.controller.cluster.datastore.ShardCommitCoordinator.access$200(ShardCommitCoordinator.java:49)
at org.opendaylight.controller.cluster.datastore.ShardCommitCoordinator$2.onSuccess(ShardCommitCoordinator.java:243)

at org.opendaylight.controller.cluster.datastore.ShardCommitCoordinator.finishCommit(ShardCommitCoordinator.java:316)
at org.opendaylight.controller.cluster.datastore.ShardCommitCoordinator.access$400(ShardCommitCoordinator.java:49)
at org.opendaylight.controller.cluster.datastore.ShardCommitCoordinator$3.onSuccess(ShardCommitCoordinator.java:299)

Leading to a leaner stack.

Change-Id: I825da37f91749016a4d4e64e7bfb75f03f9b450b
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-8073: Improve handling of temporary files 90/53790/6
Robert Varga [Fri, 24 Mar 2017 10:54:44 +0000 (11:54 +0100)]
BUG-8073: Improve handling of temporary files

This patch reworks the logic so we end up with atomic move operations
and non-overlapping file names.

Change-Id: I4383baf664e51d8e6acfaf51f9dc5f62d77f5c14
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoAdd SerializationUtils unit test 54/53654/2
Andrej Mak [Wed, 22 Mar 2017 06:23:26 +0000 (07:23 +0100)]
Add SerializationUtils unit test

Change-Id: I7e8533c8c54c6d2cab234e9ad7db6037a97bdbdc
Signed-off-by: Andrej Mak <andrej.mak@pantheon.tech>
7 years agoAdd case for READY in RemoteProxyTransaction 12/53712/4
Andrej Mak [Thu, 23 Mar 2017 10:01:47 +0000 (11:01 +0100)]
Add case for READY in RemoteProxyTransaction

Handling forwarded ModifyTransactionRequest with ready
protocol shouldn't cause failure, so add no op case.

Change-Id: Id8d69b49171588323ccd947b53f16576f57cb156
Signed-off-by: Andrej Mak <andrej.mak@pantheon.tech>
7 years agoBUG-8027: do not break actor encapsulation 47/53747/2
Robert Varga [Thu, 23 Mar 2017 17:10:58 +0000 (18:10 +0100)]
BUG-8027: do not break actor encapsulation

Invoking abort() from ShardTransaction means we are executing code
from one actor in the context of another one and since the code path
involves persistence, this breaks Akka rather thoroughly.

Introduce a dedicated method for the required upcall and send a request
to persist separately.

Change-Id: Ic994b5e5963e8c602844e283f34df8bfa3726705
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-5280: fix NPE during transaction purge 31/53731/2
Robert Varga [Thu, 23 Mar 2017 13:13:44 +0000 (14:13 +0100)]
BUG-5280: fix NPE during transaction purge

Read/write transactions which transition to ready state
throw away their open transaction, which causes the following
exception:

Shard - member-1-shard-people-testTransactionChainWithMultipleShards: request Envelope{sessionId=1, txSequence=11, message=TransactionPurgeRequest{target=member-2-datastore-testTransactionChainWithMultipleShards-fe-0-chn-1-txn-2-2, sequence=2, replyTo=Actor[akka://cluster-test@127.0.0.1:2559/user/$a#-493460599]}} caused failure
java.lang.NullPointerException
 at org.opendaylight.controller.cluster.datastore.FrontendReadWriteTransaction.purge(FrontendReadWriteTransaction.java:113)
 at org.opendaylight.controller.cluster.datastore.AbstractFrontendHistory.handleTransactionRequest(AbstractFrontendHistory.java:114)
 at org.opendaylight.controller.cluster.datastore.LeaderFrontendState.handleTransactionRequest(LeaderFrontendState.java:197)
 at org.opendaylight.controller.cluster.datastore.Shard.handleRequest(Shard.java:413)
 at org.opendaylight.controller.cluster.datastore.Shard.handleNonRaftCommand(Shard.java:277)

Rework purge logic to talk directly to the data tree, which
prevents this from happening and simplifies the code a bit.

Change-Id: I7cc08687648d2473a712c171944a06307e4d8f9f
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoAdd QuarantinedMonitorActor unit test 13/53613/4
Andrej Mak [Tue, 21 Mar 2017 14:08:38 +0000 (15:08 +0100)]
Add QuarantinedMonitorActor unit test

Change-Id: I4e007dd15b1a632b8204812a49a6149615901af4
Signed-off-by: Andrej Mak <andrej.mak@pantheon.tech>
7 years agoAdd RoleChangeNotifier unit test 10/53610/2
Andrej Mak [Tue, 21 Mar 2017 13:03:22 +0000 (14:03 +0100)]
Add RoleChangeNotifier unit test

Change-Id: Ib2082c15fb18094e22a5800265150044d4896ee3
Signed-off-by: Andrej Mak <andrej.mak@pantheon.tech>
7 years agoBug 8015, Bug 7800: Do not block when publishing notifications 76/53476/5
Vratko Polak [Fri, 17 Mar 2017 14:07:03 +0000 (15:07 +0100)]
Bug 8015, Bug 7800: Do not block when publishing notifications

+ Yang model edited.
+ check-publish-notificatons implemented.

Change-Id: I757269a61bb819d2abcb07f6106b5e2ed7a34dec
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Signed-off-by: Tomas Cere <tcere@cisco.com>
7 years agoBug 7814: Add counter to make tx actor names unique 46/53646/1
Tom Pantelis [Wed, 22 Mar 2017 03:21:37 +0000 (23:21 -0400)]
Bug 7814: Add counter to make tx actor names unique

Appended an incrementing counter value to the actor name which
will guarantee uniqueness.

Change-Id: I0f36c4b96598c6035071ee2becb73ca9b18fee45
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoMove forwardToRemote() to LocalProxyTransaction 40/53540/2
Andrej Mak [Mon, 20 Mar 2017 08:04:45 +0000 (09:04 +0100)]
Move forwardToRemote() to LocalProxyTransaction

Method has the same body in both implementations, so
it can be moved to parrent class.

Change-Id: I25f7cb99cc3727f0cbb8da9e59343a663d776e11
Signed-off-by: Andrej Mak <andrej.mak@pantheon.tech>
7 years agoBUG-5280: make sure we propagate frontend metadata 63/49263/30
Robert Varga [Mon, 12 Dec 2016 17:59:23 +0000 (18:59 +0100)]
BUG-5280: make sure we propagate frontend metadata

This fixes an omission in initial metadata drop done as part
of I7e2c6755c3389dcb5284f17a9c6076fb9e7ac95e by registering
frontend metadata.

Change-Id: Iba85849333693484bd1870dc54d183ccc464a7ef
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoAdd AbstractProxyTransaction derived classes tests 89/53589/3
Andrej Mak [Tue, 21 Mar 2017 07:05:34 +0000 (08:05 +0100)]
Add AbstractProxyTransaction derived classes tests

Change-Id: Ie78c9213b9ca9a41066b34463557b6feb6f8b18d
Signed-off-by: Andrej Mak <andrej.mak@pantheon.tech>
7 years agoBug 6787: FeatureConfigPusher confusing WARN log removed 41/53341/5
Michael Vorburger [Wed, 15 Mar 2017 12:33:09 +0000 (13:33 +0100)]
Bug 6787: FeatureConfigPusher confusing WARN log removed

see analysis in bug: Current code already has a retry loop, and the
operation eventually succeeds; the ConcurrentModificationException
logged only created confusion and added no real value.

The code has been changed to log the last exception in the ERROR IFF
after N retries it does not succeed.

PS: We should create a generic utility helper for this ("Retryer").

Change-Id: I3c116e77f5a94366da15cc659b3a63d3a6e79f18
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
7 years agoBUG-5280: expand design documentation 88/38588/4
Robert Varga [Mon, 9 May 2016 09:44:52 +0000 (11:44 +0200)]
BUG-5280: expand design documentation

Add some more documentation on how actors communicate on the backend.

Change-Id: I1d4e39d1cff508ed0ef10901e8a09fd8d89580d1
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoAdd AbstractTransactionCommitCohort unit tests 98/53398/9
Andrej Mak [Thu, 16 Mar 2017 12:24:32 +0000 (13:24 +0100)]
Add AbstractTransactionCommitCohort unit tests

Change-Id: I18036259e022bfb3d027c82757a8c840cebb8ded
Signed-off-by: Andrej Mak <andrej.mak@pantheon.tech>
7 years agoSeal only modified modifications 15/53515/2
Jakub Morvay [Sat, 18 Mar 2017 08:44:48 +0000 (09:44 +0100)]
Seal only modified modifications

Change-Id: I839eaebbf367a44b17595070fdea76d1f879f204
Signed-off-by: Jakub Morvay <jmorvay@cisco.com>
7 years agoBUG-5280: add frontend state lifecycle 65/49265/36
Robert Varga [Mon, 12 Dec 2016 18:34:38 +0000 (19:34 +0100)]
BUG-5280: add frontend state lifecycle

When transitioning between roles we need to take care of proper
handling of state known about frontend. This patch adds
the leader/non-leader transitions, creating the state
from FrontendMetadata and forgetting it when transactions are
committed.

Our replicated log needs to grow more entries to accurately
replicate the state of the conversation between the frontend
and backend, so if a member becomes the leader it has
an understanding of which transactions and transaction
chains have been completed (aborted, committed, purged). These
are replicated before a response is sent to the frontend, so
if a leader before they replicate successfully, the frontend
will see them as a timeout and retry them (and be routed to the
new leader).

Both leader and followers are expected to keep the metadata
handy: the leader keeps for the purpose of being able to generate
a summarized snapshot. The followers keep it so their metadata
view is consistent with the contents of the data tree.

Change-Id: I72eea91ee84716cdd8a6a3521b42cca9a9393aff
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-2138: Use correct actor context in shard lookup. 38/49738/25
Jakub Morvay [Wed, 8 Mar 2017 17:32:43 +0000 (18:32 +0100)]
BUG-2138: Use correct actor context in shard lookup.

Typo since we cannot have all lookups being routed into
config.

Change-Id:I708787d7e5e6136b6a22d6f402071702a6de412b
Signed-off-by: Tomas Cere <tcere@cisco.com>
Signed-off-by: Jakub Morvay <jmorvay@cisco.com>
7 years agoBUG-2138: Fix shard registration with ProxyProducers. 63/49663/26
Tomas Cere [Tue, 20 Dec 2016 16:21:55 +0000 (17:21 +0100)]
BUG-2138: Fix shard registration with ProxyProducers.

Change-Id: I42f8f3cfaf9c0ef20b247abff2bec966ce5eeaa4
Signed-off-by: Tomas Cere <tcere@cisco.com>
7 years agoBug 7801 - Implement agent RPCs for transaction writer testing 07/53007/8
Tomas Cere [Mon, 6 Mar 2017 15:11:26 +0000 (16:11 +0100)]
Bug 7801 - Implement agent RPCs for transaction writer testing

Change-Id: I75e62deb62f39869be07fcb82f3faee53f337a7d
Signed-off-by: Tomas Cere <tcere@cisco.com>
7 years agoUnit test for RequestSuccess.java and derived classes 35/53135/8
miroslav.kovac [Fri, 10 Mar 2017 11:57:15 +0000 (12:57 +0100)]
Unit test for RequestSuccess.java and derived classes

Change-Id: Ic8998c07ae714f862e18bddccda790fc8c90ee9e
Signed-off-by: miroslav.kovac <miroslav.kovac@pantheon.tech>
7 years agoBUG-2138: DistributedShardListeners support for nested shards 89/49189/39
Tomas Cere [Thu, 8 Dec 2016 10:54:07 +0000 (11:54 +0100)]
BUG-2138: DistributedShardListeners support for nested shards

Adds support for listeners in shards that have a subshard/s,
which re-asseble notifications received from subshards.

Change-Id: Icc7dfb971731d78c306a87335e54668f3bbc133e
Signed-off-by: Tomas Cere <tcere@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-5280: Add use-tell-based-protocol config knob 97/53397/2
Robert Varga [Wed, 15 Mar 2017 10:44:04 +0000 (11:44 +0100)]
BUG-5280: Add use-tell-based-protocol config knob

The configuration knob was not documented in the corresponding configuration
file. Add it with a short explanation.

Change-Id: Ie0e866c9cf98a39568051705bbf0b10b9feaf582
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoAdd AbstractClientHandle derived classes tests 54/53354/8
Andrej Mak [Wed, 15 Mar 2017 14:24:56 +0000 (15:24 +0100)]
Add AbstractClientHandle derived classes tests

Change-Id: I9eee30289814c92b7f3e7d5b2eebf49ee575b9b3
Signed-off-by: Andrej Mak <andrej.mak@pantheon.tech>
7 years agoAdd AbstractDataStoreClientBehavior unit tests 55/53255/8
Andrej Mak [Tue, 14 Mar 2017 08:26:15 +0000 (09:26 +0100)]
Add AbstractDataStoreClientBehavior unit tests

Change-Id: I84f83c14353480c2aee54b5fc077c5c275c26f71
Signed-off-by: Andrej Mak <andrej.mak@pantheon.tech>
7 years agoAdd ClientTransactionCursorTest 71/53271/3
Andrej Mak [Tue, 14 Mar 2017 12:20:58 +0000 (13:20 +0100)]
Add ClientTransactionCursorTest

Change-Id: I8ea618446f8785f89221ee5c02f2f7e1f67bf40e
Signed-off-by: Andrej Mak <andrej.mak@pantheon.tech>
7 years agoBug 6564: Fix UndeclaredThrowableException from Proxy 12/53412/1
Michael Vorburger [Thu, 16 Mar 2017 15:47:37 +0000 (16:47 +0100)]
Bug 6564: Fix UndeclaredThrowableException from Proxy

from LegacyEntityOwnershipServiceProviderModule

also see
http://stackoverflow.com/questions/3715298/dynamic-proxy-and-checked-exceptions
and e.g.
https://amitstechblog.wordpress.com/2011/07/24/java-proxies-and-undeclaredthrowableexception/

Change-Id: I64d0789d1c136796610c4939337185173f90cd0a
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
7 years agoModifyTransactionRequestBuilder JUnit test 27/53227/4
matus.kubica [Mon, 13 Mar 2017 13:02:00 +0000 (14:02 +0100)]
ModifyTransactionRequestBuilder JUnit test

Change-Id: I42d04b95fc38b53e0877965240c0ef23546875fc
Signed-off-by: matus.kubica <matus.kubica@pantheon.tech>
7 years agoUnit tests: add serialization tests 85/53085/18
Ivan Hrasko [Thu, 9 Mar 2017 14:45:27 +0000 (15:45 +0100)]
Unit tests: add serialization tests

- remove separate tests for proxy
- proxy classes are tested with serialization tests

Change-Id: I238d02d4c33a417c5d13d4ac1f59389d79594e4e
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
7 years agoBug 7800 - Implement agent RPCs for Yang notification testing 20/52320/10
Tomas Cere [Mon, 27 Feb 2017 15:32:56 +0000 (16:32 +0100)]
Bug 7800 - Implement agent RPCs for Yang notification testing

Change-Id: Ia09ada21a737714a0feaa6be4a019ee1703b6d52
Signed-off-by: Tomas Cere <tcere@cisco.com>
7 years agoAdd TransmitQueue unit tests 74/53074/5
Andrej Mak [Thu, 9 Mar 2017 12:29:02 +0000 (13:29 +0100)]
Add TransmitQueue unit tests

Change-Id: Id7067db80a3ba4f8befec1b8bccf764db2419eb7
Signed-off-by: Andrej Mak <andrej.mak@pantheon.tech>
7 years agoAdd VotingFuture unit test 81/53081/6
Andrej Mak [Thu, 9 Mar 2017 14:19:38 +0000 (15:19 +0100)]
Add VotingFuture unit test

Change-Id: Ib3abc7c59d1047d508e5d2446acc50ebf67e1b44
Signed-off-by: Andrej Mak <andrej.mak@pantheon.tech>
7 years agoBUG-2138: Make DistributedShardFactory return Futures. 69/48869/41
Tomas Cere [Wed, 30 Nov 2016 13:13:50 +0000 (14:13 +0100)]
BUG-2138: Make DistributedShardFactory return Futures.

Since the cds shard creation runs asynchronously having Futures in the api
is more appropriate.

Change-Id: Iac5cb4827c6c125fd76074ea0411b13ac881f58d
Signed-off-by: Tomas Cere <tcere@cisco.com>
7 years agoFix config-netty-config's dependencies 73/53173/2
Robert Varga [Sat, 11 Mar 2017 15:53:36 +0000 (16:53 +0100)]
Fix config-netty-config's dependencies

This artifact carries only an XML file, there is no need
to pull in the mdsal infrastructure. This fixes the karaf4
feature.xml so it does not include mdsal bundles.

Change-Id: I2433cc7574e5bf237866fd509f235c55d5fe2e13
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoUse guava-testlib's FakeTicker 59/53159/3
Robert Varga [Fri, 10 Mar 2017 16:53:20 +0000 (17:53 +0100)]
Use guava-testlib's FakeTicker

Rather than rolling our own, use the Ticker class available
in guava-testlib.

Change-Id: If3d1abec6aad20b439e19fbd48d961b7582aa607
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBug 7814: Fix InvalidActorNameException 00/53100/5
Tom Pantelis [Fri, 10 Mar 2017 23:03:11 +0000 (18:03 -0500)]
Bug 7814: Fix InvalidActorNameException

When a read tx actor is created in the Shard, the actor name is generated
as eg "shard-member-1:datastore-operational@0:19" where 0 is the instance's
static generation id and 19 is the tx id. If the tx was created from a chain,
the chain's history id is appended. So every part of the name is constant for
the controller instance except the tx id, which is generated via a counter in
AbstractTransactionContextFactory, and the history id which is also generated
via a counter. The counters do make the full tx id unique in the cluster.
However if multiple shards are involved in a single front-end transaction,
they all have the same tx id and thus the actor names generated by each shard
would be the same. It seems that's what occurred in Bug 7814. Therefore I
changed the actor name to include the shard name.

Change-Id: Iacb11bb401bd6bded38847690f8009c115ee0637
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoFix FindBugs warning around static invocation 87/52887/5
root [Mon, 6 Mar 2017 14:32:44 +0000 (15:32 +0100)]
Fix FindBugs warning around static invocation

For some reason FB does not like our copy-pasted code,
so centralize the formatting primitive into a dedicated
method.

Change-Id: Ia73c5d5b163181b476f0a8ac3eb4744e9d9538d3
Signed-off-by: root <rovarga@cisco.com>
7 years agoBug 6859: Binding generator v1 refactoring 41/53141/1
Martin Ciglan [Fri, 10 Mar 2017 13:38:13 +0000 (14:38 +0100)]
Bug 6859: Binding generator v1 refactoring

based on https://git.opendaylight.org/gerrit/#/c/53140/,
make sure Controller compiles

Change-Id: I0d16ef9a278983f94166ea427174a479dac86581
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoUnit tests for RequestFailure derived classes 79/53079/5
Ivan Hrasko [Thu, 9 Mar 2017 13:31:03 +0000 (14:31 +0100)]
Unit tests for RequestFailure derived classes

Change-Id: I3b9fb7f6707b4519ea91880a369cfba0af24eb4e
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
7 years agoUnit test for AveragingProgressTracker class 97/52997/7
miroslav.kovac [Wed, 8 Mar 2017 12:03:38 +0000 (13:03 +0100)]
Unit test for AveragingProgressTracker class

Change-Id: Ice50c174cfe365e171aef1b3c4485cf49356c534
Signed-off-by: miroslav.kovac <miroslav.kovac@pantheon.tech>
7 years agoCache MapJoiner 92/52892/6
Robert Varga [Mon, 6 Mar 2017 15:05:09 +0000 (16:05 +0100)]
Cache MapJoiner

There is no need to instantiate the Joiner everytime we format
a map, as the instance is immmutable and thread-safe. Cache
a single object, allowing for slightly faster access.

Change-Id: Idff936f6525059d0e9abd6eae1370fd3066996a4
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-5280: Invoke both close and purge at the same time 85/52885/7
Robert Varga [Mon, 6 Mar 2017 14:13:22 +0000 (15:13 +0100)]
BUG-5280: Invoke both close and purge at the same time

There is no need to gate purge step on the close step
with the current frontend code. Enqueue both steps at the same
time, improving efficiency.

Change-Id: Ia47fa598f7d3798889d03d1f70896c75eff313ea
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBug 7799: Set inactive on any flapping service error 69/53069/4
Vratko Polak [Thu, 9 Mar 2017 10:57:26 +0000 (11:57 +0100)]
Bug 7799: Set inactive on any flapping service error

Also updated the Yang model to a corresponding description.

Change-Id: Ia1d4a815ad3e03b35f4daa9a57ddb8ba610d4003
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
7 years agoAdd FrontendTypeTest 34/52634/5
Andrej Mak [Thu, 2 Mar 2017 11:38:21 +0000 (12:38 +0100)]
Add FrontendTypeTest

Change-Id: Ie3129ef8b5147e8f9dfb4be51a6bfa906c5aff65
Signed-off-by: Andrej Mak <andrej.mak@pantheon.tech>
7 years agoAdd cds-access-client unit tests 09/53009/4
Andrej Mak [Wed, 8 Mar 2017 14:36:52 +0000 (15:36 +0100)]
Add cds-access-client unit tests

Change-Id: I9950569d45f26741022ba5a34a744b81474e662e
Signed-off-by: Andrej Mak <andrej.mak@pantheon.tech>
7 years agoBug 7901: Prevent null Modification in BatchedModifications 83/52883/4
Tom Pantelis [Mon, 6 Mar 2017 13:44:41 +0000 (08:44 -0500)]
Bug 7901: Prevent null Modification in BatchedModifications

Caused by: java.lang.NullPointerException
   at org.opendaylight.controller.cluster.datastore.modification.
      MutableCompositeModification.writeExternal(MutableCompositeModification.java:120)

Somehow a null Modification instance got added to the modifications List.
Looking at the callers of addModification, it is not clear which call site
might have been the culprit. So I added a guard in addModification against
a null input Modification and logged an error with stack trace. I also
modified getModifications to return an immutable List to prevent callers
from directly modifying the List (there was one).

Change-Id: Ic63aa9daada0548da05fe663a0d22cdcb3e7bceb
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoFix timing issue in testChangeToVotingWithNoLeader 47/53047/3
Tom Pantelis [Thu, 9 Mar 2017 05:00:12 +0000 (00:00 -0500)]
Fix timing issue in testChangeToVotingWithNoLeader

RaftActorServerConfigurationSupportTest#testChangeToVotingWithNoLeader
failed on jenkins:

  RaftActorServerConfigurationSupportTest.testChangeToVotingWithNoLeader:1213 getStatus expected:<OK> but was:<NO_LEADER>

In the following test code:

  MessageCollectorActor.clearMessages(node1Collector);

  long term = ...
  node1RaftActorRef.tell(new AppendEntries(...). ActorRef.noSender());

  // Wait for the ElectionTimeout to clear the leaderId...

  MessageCollectorActor.expectFirstMatching(node1Collector, ElectionTimeout.class)

It expects an ElectionTimeout message to occur after the AppendEntries tell
but it's possible for an ElectionTimeout message to occur in between
clearMessages and tell calls which leads to the subsequent NO_LEADER b/c the
leaderId wasn't cleared yet via a subsequent ElectionTimeout message.

The test expects the leaderId to be cleared after the AppendEntries tell so
I changed it to explicitly check for that. The fact that it's actually cleared
as a side effect of an ElectionTimeout message is an implementation detail
anyway.

Change-Id: I66eaad090d0e75fc3731e59f0a345cb04b4f2c4c
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoAdd cds-access-client unit tests 91/52891/7
Andrej Mak [Mon, 6 Mar 2017 14:53:55 +0000 (15:53 +0100)]
Add cds-access-client unit tests

Change-Id: I0f330dfd02d1562d0965a9d3a27721970d5fece8
Signed-off-by: Andrej Mak <andrej.mak@pantheon.tech>
7 years agoUnit test for NoProgressException class 98/52998/2
miroslav.kovac [Wed, 8 Mar 2017 09:06:24 +0000 (10:06 +0100)]
Unit test for NoProgressException class

Change-Id: I382413bbf2e088f4a55a7f1a1c0af18e4603705f
Signed-off-by: miroslav.kovac <miroslav.kovac@pantheon.tech>
7 years agoUnit tests for TransactionSuccess derived classes 32/52932/13
Ivan Hrasko [Tue, 7 Mar 2017 09:42:22 +0000 (10:42 +0100)]
Unit tests for TransactionSuccess derived classes

Change-Id: I4f5a27d86875f53d1dee28350c16af79fd97eef0
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
7 years agoUnit tests for Request derived classes 96/52896/15
Ivan Hrasko [Mon, 6 Mar 2017 15:09:20 +0000 (16:09 +0100)]
Unit tests for Request derived classes

Change-Id: I56d98cb89bf0cc474e69a797553aace1d8c2c040
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
7 years agoUnit tests for AbstractRequestProxy derived classes 68/52768/17
Ivan Hrasko [Fri, 3 Mar 2017 14:34:56 +0000 (15:34 +0100)]
Unit tests for AbstractRequestProxy derived classes

Change-Id: Id7eb9c30a147496dcb765843d4eb3463402c0df5
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
7 years agoBUG-2138: Listener support in shard frontend 39/48739/40
Tomas Cere [Mon, 28 Nov 2016 13:30:00 +0000 (14:30 +0100)]
BUG-2138: Listener support in shard frontend

Change-Id: Icc997649ab56dc66a95d53f11c514fa3f2cc457f
Signed-off-by: Tomas Cere <tcere@cisco.com>
7 years agoBUG-2138: Create DistributedShardFrontend 29/46829/76
Tomas Cere [Wed, 7 Sep 2016 11:48:27 +0000 (13:48 +0200)]
BUG-2138: Create DistributedShardFrontend

Use the abstract shard implementations from md-sal to create
a frontend implementation of a cds shard that forwards requests
to backend shards via DistributedDatastoreClient.

Change-Id: I7a3485f414368728e71ab2746c84d7a0f83f1436
Signed-off-by: Tomas Cere <tcere@cisco.com>
7 years agoBUG 7799: Implement agent RPCs for singleton rapid un-registration testing 16/52216/8
Tomas Cere [Thu, 23 Feb 2017 15:15:23 +0000 (16:15 +0100)]
BUG 7799: Implement agent RPCs for singleton rapid un-registration testing

Change-Id: I080a8af30c2a47e2046b0235ea75055e4c4a51cf
Signed-off-by: Tomas Cere <tcere@cisco.com>