controller.git
4 years agoSend commitIndex updates to followers as soon as possible 86/82486/8
Robert Varga [Tue, 11 Jun 2019 13:42:34 +0000 (15:42 +0200)]
Send commitIndex updates to followers as soon as possible

When the commitIndex gets updated when we reach consensus, we should
propagate this fact to the sender peer. Otherwise data tree change
listeners on peers may be unnecessarily delayed, as they end up
waiting for heartbeat interval (or non-batched entries) to be propagated
out.

The results in observably-better behaviour between leader and follower,
as the leader is sending out notifications of consensus, without
delayling for heartbeat -- which is reflected in the changes to
LeaderTest.

Furthermore, DelayedMessagesElectionScenarioTest is detecting the change,
as two members may achieve asynchronous consensus -- hence the leader
would be sending two messages (request to persist, commitIndex) to push
the consensus out. This exposes a race in the test, where we do not know
the order between TimeoutNow and AppendEntries. If AppendEntries is
processed by member 2 after TimeoutNow, leader will know about the new
term due to AppendEntriesReply we send out. The cluster will still
converge, but the assert for leader will be different if it manages to
process the message. Fix this by isolating member 2.

JIRA: CONTROLLER-1900
Change-Id: I695ef25c7a4cf8799c9c5e04c2c33fbf3e2f21df
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse Files.delete() in LocalSnapshotStore 28/82228/2
Tomas Cere [Thu, 23 May 2019 08:04:16 +0000 (10:04 +0200)]
Use Files.delete() in LocalSnapshotStore

If delete fails, it needs to be logged so change this up.

Change-Id: If4051cb3e5b83dee51f919fc1713cc17f032597e
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
(cherry picked from commit d8ef44c67accea4006489e4cbb6c8f0d4d428b6a)

4 years agoBump yangtools to 2.0.20 94/82094/6
Robert Varga [Wed, 15 May 2019 13:14:25 +0000 (15:14 +0200)]
Bump yangtools to 2.0.20

This brings in latest fixes.

Change-Id: I4edd67eb5547806f2cb6dcc8e4f17814d1d2046e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump odlparent to 3.1.7 93/82093/5
Robert Varga [Wed, 15 May 2019 13:13:57 +0000 (15:13 +0200)]
Bump odlparent to 3.1.7

This brings in latest upstream upgrades.

Change-Id: I26751df871ffc53cc2e8e153930a6f17fe31f642
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDo not enque purges for ask based protocol 22/82222/1
Tomas Cere [Thu, 16 May 2019 12:12:01 +0000 (14:12 +0200)]
Do not enque purges for ask based protocol

With metadata disabled for ask based protocol, there is no need
to purge transaction on the backend and pollute the journal.

Tell based protocol has purges handled by the fronted so it
should be safe for us to remove them on the backend for ask
protocol.

JIRA: CONTROLLER-1879
Change-Id: Ia5c9470782bb4d59b78bbaa605ee5d36c7fb1644
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
(cherry picked from commit 4944f54d4e1fc24404d55e4ab74b6de212844dcd)
(cherry picked from commit 9ba29cd861d75d328aa67d53726250226dc8e438)

4 years agoRemove PersistAbortTransactionPayload 21/82221/1
Tomas Cere [Tue, 14 May 2019 10:56:04 +0000 (12:56 +0200)]
Remove PersistAbortTransactionPayload

With the metadata tracking disabled for ask based protocol
there is no need to track aborts for read only transactions
on the backend.

JIRA: CONTROLLER-1879
Change-Id: I189ae3231bb2f3c0eaa0bbe21a14342446708c5f
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
(cherry picked from commit 7011afc1380ca25ad3de4cc8865f12fe3f5e09cf)
(cherry picked from commit f437308703b0386e870f3525f19a3c3b997e8baa)

4 years agoDisable transaction tracking for ask-based protocol 20/82220/1
Robert Varga [Thu, 16 May 2019 13:54:29 +0000 (15:54 +0200)]
Disable transaction tracking for ask-based protocol

When we encounter an ask-based protocol message on a leader,
we persist a payload to make sure no state tracking occurs
for that client.

JIRA: CONTROLLER-1879
Change-Id: I3d12a06ce9e5b65ada5b59bde9f9b5486e5e4ef7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
(cherry picked from commit c413251d63152cc70fce767de0a3776f16b9a27d)
(cherry picked from commit bdc460d60b6c51e5c9e3aa4dc67cd9e4fe1b05c7)

4 years agoAllow transaction tracking to be disabled 19/82219/1
Robert Varga [Fri, 10 May 2019 10:25:31 +0000 (12:25 +0200)]
Allow transaction tracking to be disabled

Ask-based protocol does not need tracking of transactions and
histories, as it is not retransmitting requests. It also does
not inform backend about purely-local aborted transactions
(read-write and read-only), which leads to transaction tracking
rangesets having holes where those IDs are used.

This adds the prerequisite handling of disabling from the leader
without adding the actual mechanics.

JIRA: CONTROLLER-1879
Change-Id: I133e7688b492336937f394f0f6c3f080a05a820f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
(cherry picked from commit 33ade248cf6070455349fe343c0d0fd48d274717)
(cherry picked from commit cfdfdee3a15d60a13dcee57d0679a517688d1126)

4 years agoDerive config-artifacts from odlparent-lite 76/82076/1
Robert Varga [Wed, 15 May 2019 07:58:52 +0000 (09:58 +0200)]
Derive config-artifacts from odlparent-lite

This is to fix failures seen on promoting to Central.

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

4 years agoPoison entries outside of main lock 33/82033/1
Robert Varga [Tue, 7 May 2019 17:42:26 +0000 (19:42 +0200)]
Poison entries outside of main lock

Poisoning entries may involve reaction from their callbacks, which
can attempt to circle back through connections.

Make sure we poison them outside of lock context, so that any
callbacks end up seeing a poisoned connection, but without the lock
being held -- hence the locks can be acquired in-order.

JIRA: CONTROLLER-1893
Change-Id: I26551d052307812e76f3e45024a77dbb83312b17
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit e983d61d93fe2da50f9c4112fa28c7fe4ee5ffef)

4 years agoAllow SnapshotBackedReadTransaction customization 57/81957/1
Robert Varga [Wed, 8 May 2019 10:28:24 +0000 (12:28 +0200)]
Allow SnapshotBackedReadTransaction customization

In some specific cases we need to customize abort-like handling,
which is already implemented for write-like transactions, but is
not present for read-only transaction.

This patch adds the capability to attach a close() handler and
makes sure AbstractSnapshotBackedTransactionChain takes advantage
of it.

JIRA: CONTROLLER-1879
Change-Id: Ic7027956556b5dd25120ee81613a6151e5dbc501
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoEnqueue purge payload directly 47/81947/1
Robert Varga [Tue, 7 May 2019 14:23:19 +0000 (16:23 +0200)]
Enqueue purge payload directly

When we are sending abort+purge, make sure we propagate it out
as soon as possible.

Change-Id: I2b63aa20867a8b99b779115f0bb448c0e8ac9a22
JIRA: CONTROLLER-1879
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 04547138454b730148250f38979436cb839b9892)

4 years agoMake sure we purge transaction on abort 41/81941/1
Robert Varga [Tue, 7 May 2019 11:22:10 +0000 (13:22 +0200)]
Make sure we purge transaction on abort

In case of read-only transactions it is not sufficient to just
persist the abort payload, we need to also purge the transaction.

Change-Id: I8761040d074743b5a1c5eebbecc6449c30abe47e
JIRA: CONTROLLER-1879
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit bc301a153a07be7c23327e85179974422624c80a)

4 years agoReset snapshot progress after timeout has been hit 22/81922/1
Tomas Cere [Tue, 30 Apr 2019 08:49:02 +0000 (10:49 +0200)]
Reset snapshot progress after timeout has been hit

Add a stopwatch to LeaderInstallSnapshotState that allows
us to keep track whether a follower took too much time to respond
to InstallSnapshot for whatever reason allowing us to retry
chunks that time out.

JIRA: CONTROLLER-1891
Change-Id: Id443a4cc7a069ad4d9982d537d9a8d82b845ac35
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
(cherry picked from commit f33beecf2a10955a9219757529ba3017079816cc)

4 years agoHarden ShardCommitCoordinator to survive EOS write retries 00/81800/1
Tomas Cere [Fri, 26 Apr 2019 10:37:38 +0000 (12:37 +0200)]
Harden ShardCommitCoordinator to survive EOS write retries

EntityOwnershipShard can break the usual shard rule of only one 3PC
running at one time, causing the retrying write attempting to modify
an already sealed modification.

Change-Id: Iaa56b68a30f9191f7aa14428f39d4d7524aeb09d
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
(cherry picked from commit bb04f62f467cc6e6f0922ba8957b09715707940d)

5 years agoDo not break actor containment 80/81680/1
Tomas Cere [Tue, 9 Apr 2019 08:46:18 +0000 (10:46 +0200)]
Do not break actor containment

During async persistence the actor containment is broken which
results in applyState being called directly from the persistence actor.
This means that the ClientRequestTracker might be missing an entry
for the transaction and the transaction being applied as a foreign candidate
in ShardDataTree.
If this happens there will be a transaction stuck in COMMIT_PENDING state,
blocking any further progress in the shard until its restarted.

JIRA: CONTROLLER-1890
Change-Id: I944b233d13103df08b68baeaf3907c064d1d526e
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix checkstyle in toaster-it 16/81316/1
Robert Varga [Thu, 28 Mar 2019 18:54:43 +0000 (19:54 +0100)]
Fix checkstyle in toaster-it

Simple whitespace cleanup to keep checkstyle happy.

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

5 years agoMigrate to use openCursor() 15/81315/1
Robert Varga [Thu, 28 Mar 2019 16:26:24 +0000 (17:26 +0100)]
Migrate to use openCursor()

createCursor() has been deprecated long time ago, use its replacement
instead.

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

5 years agoFix logging messages 14/81314/1
Robert Varga [Thu, 28 Mar 2019 13:32:44 +0000 (14:32 +0100)]
Fix logging messages

Upgraded spotbugs is finding more violations, fix them up.

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

5 years agoUse ReusableNormalizedNodePruner in PruningDataTreeModification 04/81304/1
Robert Varga [Thu, 28 Mar 2019 12:01:48 +0000 (13:01 +0100)]
Use ReusableNormalizedNodePruner in PruningDataTreeModification

Rather than instantiating a pruner for each invocation, keep an
instance around for reuse. In order to facilitate free-standing
modifications, we also keep a reference to the DataSchemaContextTree
bound our current SchemaContext.

JIRA: CONTROLLER-1887
Change-Id: I5d310b12feb1ff46dc2af0e67294a925d48a4957
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 8f30cbc0ba2676e883faadba10f757881983b2d0)

5 years agoAdd ReusableNormalizedNodePruner 03/81303/1
Robert Varga [Thu, 28 Mar 2019 11:46:34 +0000 (12:46 +0100)]
Add ReusableNormalizedNodePruner

This version of NormalizedNodePruner is reusable across invocations,
and improving CPU and memory efficiency in bulk operations due to
not needing to allocate stack nor lookup DataSchemaContextTree.

JIRA: CONTROLLER-1887
Change-Id: I1798f5f6255cd23702bf3792c1f4f5149f92d208
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 7bef3c9e3f411d3e4abdb5ff43a618537cc9c936)

5 years agoMove checkNotSealed() to addBuilder() 02/81302/1
Robert Varga [Thu, 28 Mar 2019 10:22:55 +0000 (11:22 +0100)]
Move checkNotSealed() to addBuilder()

addBuilder() is called after previous check for seal from all callers,
who do not have any side-effects aside allocating arguments to
addBuilder().

Move the call to checkNotSealed() to addBuilder(), making the code
more straightforward and possibly preventing bugs from creeping in.

JIRA: CONTROLLER-1887
Change-Id: I127385378957deb7f38f1203870a0e52cd630644
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 35fe9a2bb63d451d820707f5142349539334a7ad)

5 years agoRemove NormalizedNodePruner.findSchemaNodeForNodePath() 01/81301/1
Robert Varga [Thu, 28 Mar 2019 10:16:27 +0000 (11:16 +0100)]
Remove NormalizedNodePruner.findSchemaNodeForNodePath()

DataSchemaContextTree.findChild() provides equivalent functionality,
so use that instead of brewing our own.

JIRA: CONTROLLER-1887
Change-Id: Ia55ac99ce8fa37daf06ce0e7e1615f1bd0a07123
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit b62499730040256c5be1539f409f4a98b557099e)

5 years agoDo not use Optional in NormalizedNodeWrapper 00/81300/1
Robert Varga [Thu, 28 Mar 2019 09:58:49 +0000 (10:58 +0100)]
Do not use Optional in NormalizedNodeWrapper

Use nullable schema instead, as the caller is package-private and
ends up unpacking the return anyway. This simplifies
NormalizedNodePruner a bit.

JIRA: CONTROLLER-1887
Change-Id: I395dd8266bd7198f66890c4ae3633ecda9281726
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit c4a5948ad86ce0f982d3f00cb7d300c9244b123c)

5 years agoHide NormalizedNodeBuilderWrapper 99/81299/1
Robert Varga [Thu, 28 Mar 2019 07:48:02 +0000 (08:48 +0100)]
Hide NormalizedNodeBuilderWrapper

This class is not instantiable outside of the package is it does
not leak from NormalizedNodePruner -- therefore it cannot be used
by anyone else. Make sure it's package-private and clean it up
a bit.

JIRA: CONTROLLER-1887
Change-Id: I17911508273d68c2795d38e2156c9407522f55fe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 8fe9ec767ec28d41f55e9714ca69fe08e64f71f0)

5 years agoRemove NormalizedNodePruner.SimpleStack 98/81298/1
Robert Varga [Wed, 27 Mar 2019 22:51:57 +0000 (23:51 +0100)]
Remove NormalizedNodePruner.SimpleStack

This custom implementation is highly inefficient, because:
1) peek/pop operations perform get(int) and remove(int) operations
   on ArrayList, which are highly inefficient O(N)
2) it allocates an object for each entry

Replace this class with a stock Deque, which takes care of the first
problem, as push/pop/peek are amortized O(1).

For implementation use an ArrayDeque, which takes care of the second
problem, as stack entries are reused.

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

5 years agoClean up NormalizedNodePruner 97/81297/1
Robert Varga [Wed, 27 Mar 2019 22:45:15 +0000 (23:45 +0100)]
Clean up NormalizedNodePruner

- shorten YangInstanceIdentifier.PathArgument references
- do not declare runtime exceptions as thrown
- use a space after comma

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

5 years agoUpdate javadoc links 96/81296/1
Robert Varga [Fri, 22 Mar 2019 19:32:32 +0000 (20:32 +0100)]
Update javadoc links

Our javadoc links are pointing to deprecated Guava methods, update
them to point to their equivalents, as they are going away in our
next upgrade.

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

5 years agoImprove aborted transaction logging 23/80423/2
Robert Varga [Wed, 20 Feb 2019 13:47:12 +0000 (14:47 +0100)]
Improve aborted transaction logging

The fact that a snapshot is recorded does not mean it has not been
closed -- in fact write-aspect transactions do not actively remove
themselves.

When we prune recorded snapshots on transaction chain close, we need
to pay attention to the return value of abort(), as that is
indicating whether we should in fact warn about an unclosed
transaction.

This means that the actual set of transactions we warn about cannot
be determined until we have traversed all recorded snapshots, hence
modify the logic to record the identifiers that were in fact aborted
and report all of them in a single message along with a stack trace
so the offender may be identifier.

Change-Id: I8b176f1990c9aa9c056cd03203ea50fb9b9549a0
JIRA: CONTROLLER-1886
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 21eed79684671b9a44e34edbd589419cb9bb6087)

5 years agoDo not assert seal transition on forward path 25/80425/1
Robert Varga [Wed, 20 Feb 2019 12:56:30 +0000 (13:56 +0100)]
Do not assert seal transition on forward path

Unlike the replay path, where we expect no successor, the forward
path may very well encounter a successor being present.

Move the assertion to replay path only, as that is where it catches
issues. The forward path automatically propagates the seal via its
use of sendRequest(), which is forwarded as needed and therefore
we only note the race via LOG.debug() and not assert it.

Change-Id: I6f95acc49800d456c049d19982c801015fd69420
JIRA: CONTROLLER-1885
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit db3d7caeeb310f76a9a159f9a8d7e9beff89f645)

5 years agoFix free-standing transaction lookup with module-based shards 13/80413/2
Robert Varga [Tue, 19 Feb 2019 12:50:04 +0000 (13:50 +0100)]
Fix free-standing transaction lookup with module-based shards

When we have a combination of tell-based protocol with module-based
shards, the frontend will use the cookie within LocalHistoryIdentifier,
making it potentially non-zero.

The backend tracks free-standing transactions under a local history,
which has cookie set to zero, hence it will not match when we attempt
to look it up for the purposes commit/abort/purge -- leading to
mismatched leader state for these transactions.

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

5 years agoRemove use of CheckedFuture 12/80412/2
Robert Varga [Mon, 18 Feb 2019 17:59:03 +0000 (18:59 +0100)]
Remove use of CheckedFuture

YangTextSchemaSource uses ListenableFuture only, hence we can
remove use of deprecated Futures.immediate(Failed)CheckedFuture().

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

5 years agoMigrate to ListenerRegistry.create() 14/80414/1
Robert Varga [Tue, 19 Feb 2019 14:24:29 +0000 (15:24 +0100)]
Migrate to ListenerRegistry.create()

As per deprecation, the default constructor will be going away.

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

5 years agoAccount for reported UNMODIFIED nodes 21/80321/1
Robert Varga [Mon, 11 Feb 2019 16:00:14 +0000 (17:00 +0100)]
Account for reported UNMODIFIED nodes

DataObjectModification has no way of expressing UNMODIFIED nodes,
but they can (and are) reported from DataTreeCandidateNode, hence
we end up reporting IllegalStateException when the user tries to
look at those nodes.

Make sure we take the node under consideration and do not report
unmodified children, hence preventing the ISE from happening.

JIRA: MDSAL-422
Change-Id: I34d36ae083c5ce3ad793eb584236f175f7a3a906
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 9d4ff4c4045fdef38e3940d336d2825df29c4d65)

5 years agoBump versions by x.y.(z+1) 90/80190/1
jenkins-releng [Thu, 7 Feb 2019 09:45:03 +0000 (09:45 +0000)]
Bump versions by x.y.(z+1)

Change-Id: Ica6ff01a22a1ca88616e14fa40b3fcb91be4c0d5
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
5 years agoBump to yangtools-2.0.16 31/79731/1
Robert Varga [Sat, 19 Jan 2019 11:44:05 +0000 (12:44 +0100)]
Bump to yangtools-2.0.16

This aligns with odlparent-3.1.6.

Change-Id: Ib0f12e5c795b09f0813c6bbe5961c8fef055489d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump to odlparent 3.1.6 36/79636/1
Stephen Kitt [Fri, 18 Jan 2019 09:19:20 +0000 (10:19 +0100)]
Bump to odlparent 3.1.6

Change-Id: I7cc4d721a9105cc49f9ab364f0247b07e44f62de
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoOutput last log term on recovery complete 79/79379/1
Tom Pantelis [Wed, 9 Jan 2019 16:18:37 +0000 (11:18 -0500)]
Output last log term on recovery complete

Change-Id: Idea699d1620cf0f3d1f8173c3b08954d4d41a8d4
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
5 years agoImprove follower term conflict resolution 51/79351/1
Robert Varga [Tue, 23 Jan 2018 16:08:03 +0000 (17:08 +0100)]
Improve follower term conflict resolution

Rather than performing a linear search downwards for a matching
log entry, take into account follower's last log index. This
eliminates the need for a lot of round-trips if the follower is
far behind the leader, but does not have a complete common ancestry.

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

5 years agoinfo should be debug in CommitTransactionPayload 86/79286/1
Tom Pantelis [Mon, 7 Jan 2019 17:53:48 +0000 (12:53 -0500)]
info should be debug in CommitTransactionPayload

The log statement was recently added but should be debug.

Change-Id: I04fe1e22f9ca47826a634d9ea8748f271ac57353
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
(cherry picked from commit 7da4ebe44e626f23a453cd427b243d6cefaa9011)

5 years agoSend leader's full address via AppendEntries 82/79282/1
Tom Pantelis [Thu, 6 Dec 2018 16:43:26 +0000 (11:43 -0500)]
Send leader's full address via AppendEntries

Added the leader's full actor address to AppendEntries. The
address can be rather long and we don't need to normally send
it so it's an Optional. The follower indicates via AppendEntriesReply
whether it needs the leader to send its address (new
needsLeaderAddress field). On receipt of the leader's address,
the follower sets it in its local RaftActorContext and notifies
the PeerAddressResolver. The ShardPeerAddressResolver impl
updates its local cache thus enabling transactions to resolve
the remote leader actor.

Since we're changing the serialized footprint of AppendEntries
and AppendEntriesReply, I preserved backwards compatibility by
versioning a new externalizable Proxy for each.

JIRA: CONTROLLER-1861
Change-Id: I1c0870a596b1782015eb973153b74dfcd48694e7
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
5 years agoSpecify initial serialization buffer capacity for Payloads 45/79145/2
Tom Pantelis [Tue, 4 Dec 2018 18:02:38 +0000 (13:02 -0500)]
Specify initial serialization buffer capacity for Payloads

JFR shows a lot of re-allocations of the backing byte [] when
serializing CommitTransactionPayload. Specify a reasonable
initial buffer capacity (the default in ByteArrayOutputStream
is 32) to reduce re-allocations. This is also configurable via
the cfg file (default is 512).

Also did the same for the other smaller Payload classes like
PurgeTransactionPayload.

JIRA: CONTROLLER-1870
Change-Id: I7ebced56812bfc102409b5b2a8b7f4b1b54359fc
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
5 years agoBump yangtools to 2.0.15 47/78647/2
Robert Varga [Tue, 11 Dec 2018 13:37:23 +0000 (14:37 +0100)]
Bump yangtools to 2.0.15

This brings in latest fixes.

Change-Id: Ia901451f2fc7f821b7b491e240b4260fd3005a0d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump to odlparent 3.1.5 34/78934/2
Stephen Kitt [Fri, 21 Dec 2018 10:47:22 +0000 (11:47 +0100)]
Bump to odlparent 3.1.5

Change-Id: I8d480291ee1131245ddf9a04e32f91914a5f2ae7
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoAvoid unnecessary unsuccessful AppendEntriesReply 29/78929/2
Tom Pantelis [Fri, 14 Dec 2018 17:36:16 +0000 (12:36 -0500)]
Avoid unnecessary unsuccessful AppendEntriesReply

In some CSIT runs I see messages such as "The prevLogIndex 10 was
found in the log but the term -1 is not equal to the append entries
prevLogTerm 2" which results in the Follower sending an unsuccessful
reply indicating it's out-of-sync. This causes the Leader to try to
catch it up.

However in the test cases, the Follower isn't actually
out-of-sync but rather it gets behind enough (the test issues 1000
txns per second per node) such that the leader re-sends AppendEntries
with log entries it already sent. When the Follower eventually receives
the first AppendEntries, it appends the entries and may do a "fake"
snapshot, ie trim the in-memory journal list and advance the snapshot
index. If so, when the duplicate AppendEntries is received, the leader's
previous log index is no longer in the Follower's journal log.
In Follower.isOutOfSync, isLogEntryPresent returns true b/c the leader's
previous index is included in the last snapshot even though it was trimmed
from the journal log. However, getLogEntryTerm returns -1 b/c it
checks if the index is in the journal log or equal to the snapshot
index, ie it doesn't take into account that the index may be in the
last snapshot. This is inconsistent with the first check and results in
the Follower reporting that it's out-of-sync when it really isnt.

I've also seen a negative result of this on the Leader side when a Follower
reports it's out-of-sync - the Follower's last log index is in the snapshot
but getLogEntryTerm returns -1 causing the Leader to take the last resort,
inefficient path of decrementing the Follower's next index in order to
catch it up.

Therefore I changed these 2 cases to also check if the index is in the snapshot
and, if so, use the snapshot term.

Change-Id: I4331d8fee85789a7004a692abb1b9c629eecd570
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit c77c163d54872612b47f0f2550931fa408ed596b)

5 years agoadd real "end-to-end" coverage in TracingBrokerTest 58/78858/2
Michael Vorburger [Fri, 14 Dec 2018 15:22:49 +0000 (16:22 +0100)]
add real "end-to-end" coverage in TracingBrokerTest

This reproduces the NPE from CONTROLLER-1877,
and fails without the fix from the previous commit.

JIRA: CONTROLLER-1877
Change-Id: Ia2fa6093f8a02c37e1ff04250dcd17ab069c1bd5
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
(cherry picked from commit 26a9c9959de71fc874f84ed9bf5b314ba125657c)

5 years agofix NPE in odl-mdsal-trace 56/78856/1
Michael Vorburger [Fri, 14 Dec 2018 15:37:16 +0000 (16:37 +0100)]
fix NPE in odl-mdsal-trace

It (probably) broke back in
Commit a6286576cf76bce93009c58b88ba1e949ef717af
Change-Id: Id82a79e8e430665f6fb5433ed7bab858044eacbe.

This NPE only occurs if mdsaltrace has non-empty write-watches
(as it does in the initial default mdsaltrace_config.xml).

The following commit adds a non-regression test for this.

Caused by: java.lang.NullPointerException
  at org.opendaylight.mdsal.binding.dom.codec.impl.BindingCodecContext.getCodecContextNode(BindingCodecContext.java:152)
  at org.opendaylight.mdsal.binding.dom.codec.impl.InstanceIdentifierCodec.deserialize(InstanceIdentifierCodec.java:36)
  at org.opendaylight.mdsal.binding.dom.codec.impl.BindingNormalizedNodeCodecRegistry.fromYangInstanceIdentifier(BindingNormalizedNodeCodecRegistry.java:101)
  at org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec.fromYangInstanceIdentifier(BindingToNormalizedNodeCodec.java:215)
  at Proxyabf4ea17_f2e5_4773_bd89_e4f8393036df.fromYangInstanceIdentifier(Unknown Source)
  at Proxy1038cd39_b88e_4023_8cb1_af39f6d6feb2.fromYangInstanceIdentifier(Unknown Source)
  at org.opendaylight.controller.md.sal.trace.dom.impl.TracingBroker.toPathString(TracingBroker.java:270)
  at org.opendaylight.controller.md.sal.trace.dom.impl.TracingBroker.toPathString(TracingBroker.java:264)
  at org.opendaylight.controller.md.sal.trace.dom.impl.TracingBroker$Watch.eventIsOfInterest(TracingBroker.java:167)
  at org.opendaylight.controller.md.sal.trace.dom.impl.TracingBroker.isWriteWatched(TracingBroker.java:248)
  at org.opendaylight.controller.md.sal.trace.dom.impl.AbstractTracingWriteTransaction.recordOp(AbstractTracingWriteTransaction.java:37)
  at org.opendaylight.controller.md.sal.trace.dom.impl.AbstractTracingWriteTransaction.<init>(AbstractTracingWriteTransaction.java:32)
  at org.opendaylight.controller.md.sal.trace.dom.impl.TracingWriteTransaction.<init>(TracingWriteTransaction.java:24)

JIRA: CONTROLLER-1877
Change-Id: Ia9fbf69bc1c3553e929a045146a3610bce72cd96
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
(cherry picked from commit ce85ee4b6d9334bd0b67b0bac1d0cc3565e4ea10)

5 years agoAlways save to local copy in IdIntsListener 04/78504/1
Tom Pantelis [Sun, 2 Dec 2018 20:49:16 +0000 (15:49 -0500)]
Always save to local copy in IdIntsListener

The Listener Stability CSIT fails intermittently due to the
IdIntsListener reporting that its local view of the data
tree as captured from DTCNs does not match the final read
of the data after the writes are done and the leader change
is complete. On DTCN, the IdIntsListener only stores the new
data if the data before in the DTCN matches its stored copy of
the data from the previous DTCN. When the test fails, this
check fails early on and after that it will never match. A
prior patch added a diff of the data nodes that failed the check
which shows that the id-int entry for "prefix-1" was missing
in the stored copy. This is added at the start of the test
(each node adds its own entry). It's unclear to me if it's
actually valid to ensure that the stored copy matches the
current DTCN's data before so I removed the check - let's see
if there's any further tests failures.

Change-Id: I7b861fc85b42586832072fdc19de103733e4fbf5
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
(cherry picked from commit 78de7c0dbbb387a46c12f3e28efa15030efa6e62)

5 years agoImprove failure reporting in IdIntsListener 64/78464/1
Tom Pantelis [Fri, 30 Nov 2018 16:43:18 +0000 (11:43 -0500)]
Improve failure reporting in IdIntsListener

The Listener Stability CSIT fails intermittently where the
IdIntsListener reports that the final read of the data doesn't
match it's local copy obtained from DTCN's. It would be helpful
to output the difference.

When the test fails, there are a lot of "Ignoring notification"
warnings from IdIntsListener so output the diff the first time
that occurs.

Change-Id: I49e9cd0414a904a61778a8c028ead7dc2b8fd593
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
(cherry picked from commit 95788d18b61dd21bdd8406a9c725ad76b3044535)

5 years agoImprove error reporting in WriteTransactionsHandler 60/78460/1
Tom Pantelis [Fri, 30 Nov 2018 03:32:48 +0000 (22:32 -0500)]
Improve error reporting in WriteTransactionsHandler

The Leader Isolation CSIT is failing intermittently with a failed
tx and it would help to log the exception trace as restconf no longer
reports it. Also modified some fields to be thread-safe as they are
accessed by multiple threads although not concurrently/

Change-Id: Ifce3cd177e5e0cc7c7020866000cb915b9f9c4bf
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
(cherry picked from commit 26aee5f28675801253a1244d0c0ad74a7e51b3e4)

5 years agoAdd specific serializer for SimpleReplicatedLogEntry 26/78426/1
Tom Pantelis [Mon, 3 Dec 2018 17:59:43 +0000 (12:59 -0500)]
Add specific serializer for SimpleReplicatedLogEntry

JFR shows a lot of re-allocations of the backing byte [] when
serializing SimpleReplicatedLogEntry. We can pretty closely
estimate the total serialized size with some reasonable padding
since the Payload is already serialized. Introduce a
specific akka serializer for this.

Jira: CONTROLLER-1872
Change-Id: I94ac9528657119b5bab60dc2f37eef98f18ca1b0
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
(cherry picked from commit 4ecb8ecaf04594b3312a44d801423f515ea445b3)

5 years agoUpdate procedure to restart controller on quarantined condition. 83/77283/3
Ajay Lele [Mon, 15 Oct 2018 18:23:37 +0000 (11:23 -0700)]
Update procedure to restart controller on quarantined condition.

There was a behavior change in Karaf [0] because of which restarting
the container now requires the system property karaf.restart to be
set to true in addition to karaf.restart.jvm property. Update
controller restart logic on quarantined condition for the same.

[0] https://issues.apache.org/jira/browse/KARAF-5179

Change-Id: I7b93eb87f53870efea70f2c9a9b82eeca783aa0b
Signed-off-by: Ajay Lele <ajayslele@gmail.com>
(cherry picked from commit 8db9c583f92f65d03d7688d5b65cecf7a906d918)

5 years agotell-based - reconnect on leader change 11/78211/2
Tom Pantelis [Wed, 21 Nov 2018 20:38:05 +0000 (15:38 -0500)]
tell-based - reconnect on leader change

The ShardManager is the aggregation point for shards so we need
to propagate shard leader change events etc to the ClientActorBehavior
to initiate a refresh of the backend info. The ModuleShardBackendResolver
sends a new message, RegisterForShardAvailabilityChanges, to the
ShardManager actor with a Consumer callback that is notified by the
ShardManager when events affecting shard leader availability occur.
The ModuleShardBackendResolver then propagates the event notification
to callbacks registered via a new notifyWhenBackendInfoIsStale method
exposed via the BackendInfoResolver interface, which the
ClientActorBehavior calls.

JIRA: CONTROLLER-1873
Change-Id: I9dbcabf5a75b195c811a22dd522115d329e5dc4b
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
(cherry picked from commit 1819f12a7e562482d9328a8e4c4aeffd2b1a2c01)

5 years agoUse explicit classes for Listener forwarding 09/78209/2
Robert Varga [Tue, 27 Nov 2018 12:09:30 +0000 (13:09 +0100)]
Use explicit classes for Listener forwarding

This allows us to use ForwardingObject, which will forward
toString() invocations intact, properly identifying registered
listeners.

Change-Id: I486352d41047b20cb5b2735cff911d7d49aaf963
JIRA: CONTROLLER-1874
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUse SharedSingletonMapTemplate 77/78177/2
Robert Varga [Sun, 25 Nov 2018 17:21:00 +0000 (18:21 +0100)]
Use SharedSingletonMapTemplate

We know the key statically, hence we can use more efficient maps
to hold our NodeIdentifierWithPredicates. This saves some CPU cycles
as well as produces less garbage.

JIRA: MDSAL-917
Change-Id: I55b89498ab725f8aba85f8e7f1c8bb16f0fe6565
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoImprove NormalizedNodeInputStreamReader 76/78176/2
Robert Varga [Sun, 25 Nov 2018 17:29:17 +0000 (18:29 +0100)]
Improve NormalizedNodeInputStreamReader

We really want to retain source iteration order of predicates
being streamed into the system, as they usually match the order
locally.

Refactor NormalizedNodeInputStreamReader to read complete
NodeIdentifierWithPredicate objects, thus allowing us to use
ImmutableOffsetMapTemplate to skip some data checks and copying
around.

MDSAL: YANGTOOLS-917
Change-Id: I162919c7e56109fc98933a4eeae8669b030dc992
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump yangtools to 2.0.13 34/78134/2
Robert Varga [Mon, 26 Nov 2018 08:51:46 +0000 (09:51 +0100)]
Bump yangtools to 2.0.13

This bumps yantools to latest 2.0.x release.

Change-Id: If73b8eb99219e3beb6624f22fa1528cf282c6b51
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUse pre-sized ImmutableLists for yang-data-api 55/78155/1
Robert Varga [Sun, 25 Nov 2018 17:23:50 +0000 (18:23 +0100)]
Use pre-sized ImmutableLists for yang-data-api

ImmutableList.builder() did not pre-size its arrays correctly,
leading to poor performance. That is no longer the case and we can
correctly pre-allocate it -- giving us the ArrayList equivalent in
immutable form, hence skipping copying in
{SchemaPath,YangInstanceIdentifier}.create()

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

5 years agoProxy MD-SAL interfaces in DOMMountPointServiceImpl 18/78018/5
Robert Varga [Wed, 7 Nov 2018 12:49:48 +0000 (13:49 +0100)]
Proxy MD-SAL interfaces in DOMMountPointServiceImpl

This patch deals with the case where a mount point is registered
via Controller interfaces and then accessed via MD-SAL interfaces
by providing any missing MD-SAL services via proxies built on top
of their Controller counterparts.

This also adds utility convertors to DOM{DataTree,Rpc}Identifier,
so they are readily available.

JIRA: CONTROLLER-1869
Change-Id: Iece3f1d2a2bba58669114f6f8b8abf89fd188690
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit e1ede0942d3bff1f1b150816e6bfa96ed9366c20)

5 years agoProxy controller services in DOMMountPointServiceImpl 17/78017/6
Jakub Morvay [Tue, 6 Nov 2018 18:17:44 +0000 (19:17 +0100)]
Proxy controller services in DOMMountPointServiceImpl

When we are proxying a DOMMountPoint, we also need to take care
of bridging legacy interfaces on top of MD-SAL interfaces.

This patch refactors DOM{Notification,Rpc}Router to factor out
DOM{Notification,Rpc}Service adapters and creates DOMActionService
adapter. These are then used in DOMMountPointAdapter, which in
turn is used by DOMMountPointServiceImpl.

This deals with the case when an MD-SAL-registered mount point
is accessed via Controller APIs.

JIRA: CONTROLLER-1869
Change-Id: Ide4c636afdbd13e233880ab616aec52e46ea115f
Signed-off-by: Jakub Morvay <jmorvay@frinx.io>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit ddbc3eb6ae763f10d466bfdd1c33f0cb30665bc0)

5 years agoHide DOMMountPointServiceImpl.registerMountPoint implementation 79/77579/3
Robert Varga [Wed, 7 Nov 2018 11:39:29 +0000 (12:39 +0100)]
Hide DOMMountPointServiceImpl.registerMountPoint implementation

This adds a trivial package-protected method which holds the
implementation, allowing us to short-circuit some casts.

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

5 years agoUse Method.getParameterCount() 78/77878/3
Robert Varga [Fri, 16 Nov 2018 07:33:57 +0000 (08:33 +0100)]
Use Method.getParameterCount()

Java 8 introduced this method, which bypasses array cloning done
by getParameterTypes(), making it more efficient. Take advantage
of it.

Change-Id: I130a58c8ca667e57ae29c99abdd8066d8ca7dbd7
JIRA: MDSAL-398
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix DOMDataReadTransaction javadoc 71/77771/2
Robert Varga [Wed, 14 Nov 2018 09:12:30 +0000 (10:12 +0100)]
Fix DOMDataReadTransaction javadoc

Remove double start of the javadoc.

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

5 years agoIntroduce ReadTransaction.exists() 22/77822/2
Robert Varga [Wed, 14 Nov 2018 09:11:44 +0000 (10:11 +0100)]
Introduce ReadTransaction.exists()

This method exists in the DOM API, but for some reason it was left
out if the Binding API. Introduce it as default methods riding on
the read() method and override them in all known implementations,
so the request is efficiently routed.

JIRA: MDSAL-389
Change-Id: Id56332d6f720396305ac68e40554e62fd17c34fb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit a6bdbfafe60b9aeac056187f27229e476fbf88bf)

5 years agoBump operation timeout to 500ms 07/77607/2
Robert Varga [Thu, 8 Nov 2018 01:42:03 +0000 (02:42 +0100)]
Bump operation timeout to 500ms

It seems we cannot meet our own deadlines in our unit tests, let's
bump them to 500ms instead of 100ms.

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

5 years agoBump versions by x.y.(z+1) 96/77996/1
jenkins-releng [Tue, 20 Nov 2018 23:48:13 +0000 (23:48 +0000)]
Bump versions by x.y.(z+1)

Change-Id: Ie56b4681b9f699d71bd1dba3500e749b2428928c
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
5 years agoForce UntrustedXML to be initialized from activator 66/77266/2
Robert Varga [Wed, 24 Oct 2018 21:01:25 +0000 (23:01 +0200)]
Force UntrustedXML to be initialized from activator

Touching UntrustedXML during bundle activator should cause it to
bind to the JRE XML provider rather than discovering other members
via a TCCL.

Change-Id: I9c6625be7873ed96d5e292a3165e7f319ac68b56
JIRA: CONTROLLER-1867
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump to odlparent 3.1.4 and yangtools 2.0.12 51/76851/3
Stephen Kitt [Thu, 11 Oct 2018 09:47:25 +0000 (11:47 +0200)]
Bump to odlparent 3.1.4 and yangtools 2.0.12

Change-Id: I1e74db121d23c07fefb8ddfb940f78d790709397
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoMove commit payload propagation 70/76570/1
Robert Varga [Tue, 2 Oct 2018 15:20:16 +0000 (17:20 +0200)]
Move commit payload propagation

Since Shard.persistPayload() will shortcut when we do not have
a followers or persistence, we must update metadata before we
notify the cohort of the success, as for commit-immediate
transactions that will result in a purge payload being persisted.
That payload will shortcut, too, and execute on stack, hence
metadata will see purge before commit -- leaving it in inconsistent
leaky state.

Move allMetadataCommittedTransaction() calls from
applyReplicatedPayload() down to just after we modify the data
tree and before we invoke listeners.

Change-Id: I1ed2f62756367982cfff08302c79f1c63a871df2
JIRA: CONTROLLER-1746
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 4a97740e7fe14f99dc6f6f2b07e44f4123103ce0)

5 years agoCorrect exception handling in LegacyDOMDataBrokerAdapter 58/76558/1
Robert Varga [Mon, 1 Oct 2018 09:50:13 +0000 (11:50 +0200)]
Correct exception handling in LegacyDOMDataBrokerAdapter

When a TransactionChain is closed, we need to make sure we throw
the correct (controller) exception instead of re-wrapping the mdsal
one.

Change-Id: I74434115fe14a18ba520fc789fa8a21d932a4a15
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUse LogicalDatastoreType.toMdsal() 18/76518/1
Robert Varga [Mon, 1 Oct 2018 08:39:27 +0000 (10:39 +0200)]
Use LogicalDatastoreType.toMdsal()

Use direct converter method rather than matching through name, which
results in faster mapping.

Change-Id: Ic247ebc5c5704d3eb1953eea4d7f36b1d3d49cb8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoConstruct IMDS delegate with proper type 03/76203/4
Robert Varga [Tue, 18 Sep 2018 08:35:47 +0000 (10:35 +0200)]
Construct IMDS delegate with proper type

This patch makes sure we do not ignore the datastore type, but
pass it down to MD-SAL's IMDS.

Since we are converting from controller to mdsal LogicalDatastoreType
in multiple places, centralize this via LogicalDatastoreType.toMdsal().

JIRA: MDSAL-370
Change-Id: I5e027fd439e325ff91344de98511e503fc801992
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump yangtools-2.0.11 37/76137/2
Robert Varga [Mon, 17 Sep 2018 08:59:18 +0000 (10:59 +0200)]
Bump yangtools-2.0.11

This brinsg in the latest fixes.

Change-Id: Ie576ffdd40afccd6a22170525027b9ef8c9a94d8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate controller docs to the controller project 73/75873/1
Thanh Ha [Sun, 9 Sep 2018 00:48:24 +0000 (20:48 -0400)]
Migrate controller docs to the controller project

Change-Id: Ic6ad9bade1240b08cc112f275ea2d1b4516d5446
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agoBootstrap Controller documentation 72/75872/1
Thanh Ha [Sun, 9 Sep 2018 00:44:58 +0000 (20:44 -0400)]
Bootstrap Controller documentation

Issue: DOCS-69
Change-Id: Iaf57d73e8d720b910c66cae41a75f10ceefba80f
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
5 years agoDisable artery max frame size settingd 94/75394/2
Tom Pantelis [Wed, 22 Aug 2018 22:55:12 +0000 (18:55 -0400)]
Disable artery max frame size settingd

These were accidently set really large when we were first
looking at artery a while ago but they blow up with
java.lang.OutOfMemoryError: Direct buffer memory. So
set them to the defaults and comment them out.

Change-Id: I92dc150808601271f879bc3917a036b76af8d914
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
(cherry picked from commit f605b10df459b9c9df3c697c610f5e6a71b96a0d)

5 years agoFix illegal check in CreateTransactionReply 39/75439/2
Robert Varga [Thu, 23 Aug 2018 14:02:40 +0000 (16:02 +0200)]
Fix illegal check in CreateTransactionReply

The null check is wrong here, as instanceof will evaluate to a boolean,
which will always result in a non-null reference. Fix this by using
checkArgument().

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

5 years agoFix prefix shard configuration update handling 10/75410/2
Robert Varga [Wed, 22 Aug 2018 16:48:30 +0000 (18:48 +0200)]
Fix prefix shard configuration update handling

If the list of shards is completely deleted, we end up jumping
into an empty method -- obviously missing updates. This codepath
is really shared, as DataTreeCandidateNode resolves recursively,
creating apropriate delta for children.

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

5 years agoBump versions by x.y.(z+1) 77/75577/1
jenkins-releng [Thu, 30 Aug 2018 16:51:19 +0000 (16:51 +0000)]
Bump versions by x.y.(z+1)

Change-Id: I510f3d88b49a2d101d31fe350fa01a2fea08dcc5
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
5 years agoUpdate .gitreview to stable/fluorine 70/74970/1
Anil Belur [Thu, 9 Aug 2018 12:12:24 +0000 (17:42 +0530)]
Update .gitreview to stable/fluorine

Change-Id: Iefe161b49fa8f420ffa714a91b568fdb84ef33ad
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
5 years agoBump yangtools to 2.0.10 80/74880/2
Robert Varga [Mon, 6 Aug 2018 15:44:25 +0000 (17:44 +0200)]
Bump yangtools to 2.0.10

This fixes an issue with actions, hence we need it in Fluorine.

Change-Id: I4b312e3e8ca2eafdd8a63781e78c0c019f4f7a4a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove RoutingLogic interface 53/74853/1
Tom Pantelis [Mon, 6 Aug 2018 12:56:43 +0000 (08:56 -0400)]
Remove RoutingLogic interface

This is no longer used...

Change-Id: I167eed99d7e457a7d6b1d53f39c07a1dfc6c5bf3
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
5 years agoSimplify ListenableFuture translation 27/74827/4
Robert Varga [Sat, 4 Aug 2018 01:09:51 +0000 (03:09 +0200)]
Simplify ListenableFuture translation

We can forgo instantiation of immediate futures by using a simple
.transform(Optional::fromJavaUtil).

Change-Id: If33247bc473852d739f593bb7e752323b3ac6583
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix deprecation warnings and checkstyle in benchmarks 14/71214/13
Robert Varga [Mon, 23 Apr 2018 13:49:28 +0000 (15:49 +0200)]
Fix deprecation warnings and checkstyle in benchmarks

This fixes up warnings/checkstyle and flips the enforcement switch.

Change-Id: I22754c767ef643d703286a30252cf57006062ade
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd MappingCheckedFuture 26/74826/3
Robert Varga [Sat, 4 Aug 2018 01:02:41 +0000 (03:02 +0200)]
Add MappingCheckedFuture

This class is moved here from MD-SAL, as CheckedFutures are not
used there anymore.

Change-Id: I84cda1d543a5bebdb17249943ee26ca8fe3f97bf
JIRA: MDSAL-229
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoConvert dsbenchmark to mdsal APIs 04/74804/3
Robert Varga [Fri, 3 Aug 2018 15:31:22 +0000 (17:31 +0200)]
Convert dsbenchmark to mdsal APIs

With controller interfaces deprecated, move benchmark to use MD-SAL
interfaces instead.

Change-Id: I79f52260171e3f4f770511f389bbc773e86e6939
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoReduce use of deprecated methods 03/74803/2
Robert Varga [Fri, 3 Aug 2018 15:12:49 +0000 (17:12 +0200)]
Reduce use of deprecated methods

We do not really need the old semantics in a lot of sites, so
migrate them over to replacement methods.

Change-Id: Ib60e395dd9da82934d1591555c9ad46c05dac0e7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAllow DataObjectModification to address grouping nodes 06/74606/4
Robert Varga [Sat, 28 Jul 2018 08:50:19 +0000 (10:50 +0200)]
Allow DataObjectModification to address grouping nodes

This adds the API and implementation required to address child
nodes introduced in cases by the use of a grouping.

JIRA: MDSAL-342
Change-Id: I70871dcaa3441fbef81dfb15bfd965d133aa0894
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoChange log to warn in LocalThreePhaseCommitCohort 01/74701/1
Tom Pantelis [Tue, 31 Jul 2018 18:22:14 +0000 (14:22 -0400)]
Change log to warn in LocalThreePhaseCommitCohort

Change-Id: Ieeb60989eb3665cad9cc4dc4d25c7ab7e0983437
JIRA:CONTROLLER-1855
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
5 years agoAllow filtering transaction traces with a minimum 52/74652/3
Michael Vorburger [Mon, 30 Jul 2018 13:25:05 +0000 (15:25 +0200)]
Allow filtering transaction traces with a minimum

This adds a "minimum open number of transactions" option to
trace:transactions and print out a clear final message indicating
whether any leaks were found or not.

JIRA: CONTROLLER-1765
Change-Id: Ie9f4ee263ed7defcb84c8b82dc8ec6f1f81ba07d
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agosimplify a statement in NormalizedNodeInputStreamReader 76/74476/2
Michael Vorburger [Wed, 25 Jul 2018 21:47:46 +0000 (23:47 +0200)]
simplify a statement in NormalizedNodeInputStreamReader

and fix a JavaDoc warning in NormalizedNodeOutputStreamWriter

Change-Id: I471dc3d4c8d1327fa8adaca89b8ca1d46036929d
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
5 years agoAdd Action(Provider)Adapters 10/74610/2
Robert Varga [Sat, 28 Jul 2018 11:13:52 +0000 (13:13 +0200)]
Add Action(Provider)Adapters

This adds adapters based on MD-SAL to sal-binding-broker, allowing
actions to be invoked.

Change-Id: I7efa0ef81c239d12e7d61097daa6a36391e7b89b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd (DOM)Action(Provider) bridges 09/74609/3
Robert Varga [Sat, 28 Jul 2018 10:56:34 +0000 (12:56 +0200)]
Add (DOM)Action(Provider) bridges

We need to add bridge interfaces which allow NETCONF to expose
DOMActionService through Controller's mountpoints. Also add binding
equivalents, so users of Controller Binding have access to them.

JIRA: MDSAL-283
Change-Id: Ie6b0819345928637df29c5a15bf1634f8932de19
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoImprove ProgressTracker class javadoc 80/74580/3
Vratko Polak [Mon, 26 Jun 2017 16:58:07 +0000 (18:58 +0200)]
Improve ProgressTracker class javadoc

Previously it was mentioning only "frontend" and "backend".
Now it also mentions "users", to distinguish opening and closing tasks
(which happens on user-frontend boundary) from reconnect scenarios
(which happen on frontend-backend boundary).

Change-Id: I2e1739ac40d9e1b0661d9de42099fd97e816585c
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
5 years agoConvert sal-remoterpc to mdsal APIs 97/74597/1
Tom Pantelis [Fri, 27 Jul 2018 21:12:04 +0000 (17:12 -0400)]
Convert sal-remoterpc to mdsal APIs

Change-Id: I161be27bce6f5f453e7324a737c4057493d80fa2
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
5 years agoBump yangtools to 2.0.9 73/74573/2
Robert Varga [Fri, 27 Jul 2018 12:09:03 +0000 (14:09 +0200)]
Bump yangtools to 2.0.9

This patch bumps yangtools to latest release.

Change-Id: If5342423112cd39f82232bf2379002e8cc08daed
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDeprecate controller APIs 82/74582/2
Tom Pantelis [Fri, 27 Jul 2018 14:23:15 +0000 (10:23 -0400)]
Deprecate controller APIs

Deprecated the high-level interfaces, eg DataBroker.

Change-Id: I754e3a5059c05d70616f3bd4ff3a00a05115fead
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
5 years agoAdjust to mdsal CursorAware API changes 79/74479/3
Tom Pantelis [Wed, 25 Jul 2018 22:26:30 +0000 (18:26 -0400)]
Adjust to mdsal CursorAware API changes

Corresponding mdsal patch: https://git.opendaylight.org/gerrit/#/c/74478/

Change-Id: I82041945b1f15c492f77d65c065068a6fab3878a
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
5 years agoBump to odlparent 3.1.3 93/74193/5
Stephen Kitt [Wed, 18 Jul 2018 16:06:37 +0000 (18:06 +0200)]
Bump to odlparent 3.1.3

Change-Id: I61d53cb19006ea11fd3917e6e395ce0870b7367e
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoAdjust to DOMDataTreeCommitCohort API change 71/74471/1
Tom Pantelis [Wed, 25 Jul 2018 17:17:54 +0000 (13:17 -0400)]
Adjust to DOMDataTreeCommitCohort API change

Use the new canCommit method that returns FluentFuture
instead of the deprecated CheckedFuture.

Change-Id: I110722a96c4933d32d8ff4b3237a90feddf21747
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>