controller.git
5 years agoAdd integration test for segmented journal 23/80823/3
Tomas Cere [Wed, 13 Mar 2019 11:50:55 +0000 (12:50 +0100)]
Add integration test for segmented journal

Extracts test cases for DistributedDataStore that do not need latching
in InMemoryJournal/Snapshot so we can have these run with segmented journal.

Change-Id: I0ea4e58bff0f0e8e1a40bd4f26b827623139d6c9
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
5 years agoFix segmented journal replay 22/80822/1
Tomas Cere [Tue, 12 Mar 2019 09:54:47 +0000 (10:54 +0100)]
Fix segmented journal replay

lastDelete was getting set with the incorrect value from the delete journal.
The actual written value from the delete journal needs to be used
instead of the index.
dataJournal compact also needs to be compacted upto lastDelete + 1 since
deleteUpTo is inclusive and compact keeps this value around.

Change-Id: I4a678be67fd1ad09c57273ef0fc3b7398a7d714f
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
5 years agoIntroduce candidate election timeout divisor 63/80663/2
Robert Varga [Fri, 1 Mar 2019 20:45:48 +0000 (21:45 +0100)]
Introduce candidate election timeout divisor

When a candidate is waiting for an election to occur, it is sometimes
preferable to shorten the timeout interval down, so that we do not
wait the full election timeout.

This patch introduces the knob which serves to divide the normal
timeout -- i.e. it can be halved.

Change-Id: Idbe81c39bf7aecf56b9f13a242bea89a1a4ac4f1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoPrevent a CME during actor instantiation 65/80665/3
Robert Varga [Mon, 4 Mar 2019 12:02:36 +0000 (13:02 +0100)]
Prevent a CME during actor instantiation

This issue was missed in review: createHandler() should not be
touching handlers, as it is already called from computeIfAbsent()
and hence would result in a CME with JDK11:
https://bugs.openjdk.java.net/browse/JDK-8206399

JIRA: CONTROLLER-1884
Change-Id: I8d4940b8bec2cf727d97d68796f1c9cdaaaf89d3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd SegmentedFileJournal 68/80368/10
Robert Varga [Mon, 4 Feb 2019 09:09:57 +0000 (10:09 +0100)]
Add SegmentedFileJournal

This adds an alternative Akka persistence journal implementation
based on Atomix's SegmentedJournal.

SegmentedJournal is a linear append-only log of entries, each of
which has a incrementing 63bit index. This logical structure is
stored in rolling segments -- i.e. entries are appended to current
segment until it is full, at which point a new segment is allocated
and writeout continues there. Old segments can be freed as long as
they are not needed.

This layout makes it good match to how Akka's persistence works,
with the one exception that the SegmentedJournal cannot explicitly
delete entries from the head of the journal.

SegmentedFileJournal allocates one SegmentedJournal for each
persistenceId it encounters and uses a dedicated actor for it. This
provides a major simplification in the implementation as well as
allows for concurrent persistence of multiple PersistentActors.

JIRA: CONTROLLER-1884
Change-Id: I78140b154bab44a3e17d5ffb76b040c62add3204
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRename ActorContext to ActorUtils 94/80394/4
Robert Varga [Tue, 19 Feb 2019 15:43:22 +0000 (16:43 +0100)]
Rename ActorContext to ActorUtils

ActorContext is overloaded name even within Akka, without us adding
to it. Furthermore Akka's AbstractActor defines ActorContext as its
nested class, which thoroughly breaks resolution priorities.

Rename ActorContext to ActorUtils, reducing confusion around class
uses.

Change-Id: I140239a8f74ee7deecf9ee848df0cfbbb72f3c4d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd controller aggregate javadocs 68/80568/2
Robert Varga [Sun, 24 Feb 2019 23:20:54 +0000 (00:20 +0100)]
Add controller aggregate javadocs

This adds aggregated javadocs for the controller projects.

Change-Id: If5efaa7d5dda94a7a6416230e6c2e61dd963bd90
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDo not assert seal transition on forward path 11/80411/2
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>
5 years agoImprove aborted transaction logging 15/80415/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>
5 years agoCleanup java.util.Optional references 10/80410/2
Robert Varga [Wed, 20 Feb 2019 10:46:03 +0000 (11:46 +0100)]
Cleanup java.util.Optional references

As a byproduct of gradual migration, we have a few places where
we use FQCN to reference java.util.Optional eventhough it is among
imports. Fix that.

Change-Id: Ibede76ffc614c02dbc5e29e78e6c421abcd81ec9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate to ListenerRegistry.create() 93/80393/2
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>
5 years agoFix free-standing transaction lookup with module-based shards 92/80392/3
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>
5 years agoRemove use of CheckedFuture 71/80371/1
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>
5 years agoReduce JSR305 proliferation 11/80211/6
Robert Varga [Thu, 7 Feb 2019 16:53:09 +0000 (17:53 +0100)]
Reduce JSR305 proliferation

retention=runtime annotations are mixing really badly with Java EE
injection and Java 11.

Make sure we do not use javax.annotation package in APIs and reduce
overall proliferation inside implementations.

Change-Id: I569815f0336efdc0de662c3b80f0fa6e5dd47d8a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAccount for reported UNMODIFIED nodes 67/80267/4
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>
5 years agoBump versions by x.y.(z+1) 84/80084/1
jenkins-releng [Fri, 1 Feb 2019 13:06:29 +0000 (13:06 +0000)]
Bump versions by x.y.(z+1)

Change-Id: I6a04c82981ff3244cf20416216d230d77f58f5dc
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
5 years agoMove BP xml files to standard OSGI-INF/blueprint 49/75549/7
Tom Pantelis [Tue, 22 Jan 2019 15:46:56 +0000 (10:46 -0500)]
Move BP xml files to standard OSGI-INF/blueprint

We originally used org/opendaylight/blueprint in case we needed
to customize how BP bundles are processed but this wasn't needed.
So let's move to the standard BP dir. We'll keep the
BlueprintBundleTracker as is for backwards compatibility - the only
change was to modify it to look in both dirs for BP xml files
when restarting the container for a bundle.

Change-Id: I777e831ef4d8293b49d7aa6c8cdecec96b97937f
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
5 years agoImplement DOMDataTreeChangeListener.onInitialData 02/79802/3
Tom Pantelis [Tue, 22 Jan 2019 00:50:01 +0000 (19:50 -0500)]
Implement DOMDataTreeChangeListener.onInitialData

When there's no initial data on DTCL registration, we need to
invoke onInitialData().

JIRA: CONTROLLER-1878
Change-Id: Ib6e8a822b0a6cdfa54f523cacce9ceb699463585
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
5 years agoBump to mdsal 3.0.6 06/79806/1
Stephen Kitt [Tue, 22 Jan 2019 08:50:11 +0000 (09:50 +0100)]
Bump to mdsal 3.0.6

Change-Id: I127f882c8dc93e5841da128575096c00794c4fd3
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoBump mdsal to 3.0.5 43/79743/4
Robert Varga [Sat, 19 Jan 2019 20:19:54 +0000 (21:19 +0100)]
Bump mdsal to 3.0.5

This aligns with odlparent-4.0.9 and yangtools-2.1.8.

Change-Id: If27257ddec66b02d6b7d3def493645ef1cb69c33
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump yangtools to 2.1.8 42/79742/2
Robert Varga [Sat, 19 Jan 2019 20:18:59 +0000 (21:18 +0100)]
Bump yangtools to 2.1.8

This align with odlparent-4.0.9.

Change-Id: I0bfa26a120ade132192c17da4f52968008d59950
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump to odlparent 4.0.9 64/79664/1
Stephen Kitt [Fri, 18 Jan 2019 15:32:20 +0000 (16:32 +0100)]
Bump to odlparent 4.0.9

Change-Id: I841d9cc7c6b0af646c2387492d7b799f3310d5f8
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoImprove error reporting for tell-based reads 10/78310/5
Tom Pantelis [Fri, 30 Nov 2018 03:00:34 +0000 (22:00 -0500)]
Improve error reporting for tell-based reads

Added contextual info similar to ask-based, including the
yang path of the requested read and the backend shard name.
Also wrapped RequestTimeoutException with
DataStoreUnavailableException.

Change-Id: I5487e5531034cc1abbda27a4953897da7212eba8
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
5 years agoBump mdsal to 3.0.4 09/79409/3
Robert Varga [Thu, 10 Jan 2019 10:32:17 +0000 (11:32 +0100)]
Bump mdsal to 3.0.4

This realigns odlparent/yangtools/mdsal and brings in the latest
improvements.

Also upgrade dropwizard-metrics to odlparent-propagated version.

Change-Id: Ic106db810ef170f836fcbfad24032ab348a6bd8c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump yangtools to 2.1.7 08/79408/1
Robert Varga [Thu, 10 Jan 2019 10:30:30 +0000 (11:30 +0100)]
Bump yangtools to 2.1.7

This realigns odlparent/yangtools and brings in a few minor
improvements.

Change-Id: I0d79d12f37a8f213bccebd4107d57f8683e22d2c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump to odlparent 4.0.8 58/79358/3
Stephen Kitt [Wed, 9 Jan 2019 14:54:52 +0000 (15:54 +0100)]
Bump to odlparent 4.0.8

Change-Id: I9a04273a846b08e5e5ccc5953d70221b4835b80c
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoOutput last log term on recovery complete 75/79375/2
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 34/79334/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>
5 years agoAdd info logging and improve error reporting in clustering-it 20/79320/2
Tom Pantelis [Tue, 8 Jan 2019 18:44:50 +0000 (13:44 -0500)]
Add info logging and improve error reporting in clustering-it

Change-Id: I3579a6e296a8eedfd4bc032c159eee983e792ea7
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
5 years agoinfo should be debug in CommitTransactionPayload 85/79285/2
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>
5 years agoOutput Request toString in RequestTimeoutException 84/79284/1
Tom Pantelis [Mon, 7 Jan 2019 16:43:51 +0000 (11:43 -0500)]
Output Request toString in RequestTimeoutException

It will help for debugging to see the transaction ID -
might as well output the entire Request which includes
that.

Change-Id: I63eb20dc6b883c95d4b2059a231a5848d5a7b67c
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
5 years agoSend leader's full address via AppendEntries 07/78507/5
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 agoBump odlparent to 4.0.7 99/79099/7
Robert Varga [Tue, 1 Jan 2019 17:55:01 +0000 (18:55 +0100)]
Bump odlparent to 4.0.7

This fixes SFT/Java11 failures.

Change-Id: I9ee4895c7a63df4e0713ca5899a4f7ffc9f787b1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate messagebus-impl to MDSAL APIs 06/79206/1
Robert Varga [Thu, 3 Jan 2019 20:31:11 +0000 (21:31 +0100)]
Migrate messagebus-impl to MDSAL APIs

This removes yet another user of long-deprecated APIs, migrating
it over to MD-SAL.

Change-Id: I51f2ce0e01ed3078dbd2fa4ad6eb91081d692fa3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix mdsal-it-base with JDK9+ 04/79104/4
Robert Varga [Tue, 1 Jan 2019 22:09:51 +0000 (23:09 +0100)]
Fix mdsal-it-base with JDK9+

With JDK9+ karaf-4.2.2+ requires additional VMOptions, make sure
we pass them down so the container can boot up when run with JDK9+.

Change-Id: I77760b6e48b3f4335c382a6da1e9770a912b4467
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoSwitch to spotbugs 73/79073/3
Robert Varga [Thu, 27 Dec 2018 03:46:10 +0000 (04:46 +0100)]
Switch to spotbugs

Rather than using findbugs, use spotbugs, which works with Java 9.

Change-Id: I8807b2dc34fdb4ddfd476a2a0ed9cf0db2e044cd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix CSIT failure in unsubscribeDtcl RPC 40/79140/2
Tom Pantelis [Wed, 2 Jan 2019 14:34:55 +0000 (09:34 -0500)]
Fix CSIT failure in unsubscribeDtcl RPC

https://git.opendaylight.org/gerrit/#/c/78758/ modified
the error message returned from unsubscribeDtcl if no DTCN's
are received but the CSIT test is expecting specific text content
to change it back.

Change-Id: I1791175ac1a6c5b6b9936a820646b147adf4c497
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
5 years agoFix unit test with Java 9+ 01/79101/2
Robert Varga [Tue, 1 Jan 2019 21:32:01 +0000 (22:32 +0100)]
Fix unit test with Java 9+

With https://bugs.openjdk.java.net/browse/JDK-8068730 Instant.now()
has microsecond precision, which leads to a comparison failure.

Fix this by truncating the result of Instant.now() to milliseconds.

Change-Id: Ida8172e5b02cf352325e6f516e19592be4a83d67
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agocommons-lang dependency should be scope=test 07/79007/5
Robert Varga [Sun, 23 Dec 2018 07:31:29 +0000 (08:31 +0100)]
commons-lang dependency should be scope=test

The classes are used in tests only, the dependency should be
scoped appropriately.

Change-Id: Ifb88ce765c63c0f57779dab986d6d2511060cfcd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agocommons-io dependency should be scope=test 08/79008/4
Robert Varga [Sun, 23 Dec 2018 07:42:00 +0000 (08:42 +0100)]
commons-io dependency should be scope=test

The classes are used in tests only, the dependency should be
scoped appropriately.

Change-Id: Icc0f2eca5296de62586f547363843b8e98cbac4e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoReuse odlparent common features 10/79010/3
Robert Varga [Sun, 23 Dec 2018 07:57:13 +0000 (08:57 +0100)]
Reuse odlparent common features

Rather than packaging commons-lang3 ourselves, use odlparent-provided
feature. Same goes for servlet-api and commons-text.

Change-Id: Icdd20a83cb98242e22f77dd7d8108699f1f30887
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump mdsal to 3.0.3 06/79006/2
Robert Varga [Sun, 23 Dec 2018 07:17:19 +0000 (08:17 +0100)]
Bump mdsal to 3.0.3

This brings in latest fixes and odlparent-4.0.5 alignment.

Change-Id: I852c0cf739d00cdd9815cb8e9b1643ca0cce0d88
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump to yangtools-2.1.6 and triemap-1.0.4 01/79001/2
Robert Varga [Sun, 23 Dec 2018 06:59:40 +0000 (07:59 +0100)]
Bump to yangtools-2.1.6 and triemap-1.0.4

This brings in latest fixes and odlparent-4.0.5 alignment.

Change-Id: I7de1a7af6ebbf69e1e4b1f8834dc9f5cc79080a7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump to odlparent 4.0.5 58/78958/1
Stephen Kitt [Fri, 21 Dec 2018 09:09:48 +0000 (10:09 +0100)]
Bump to odlparent 4.0.5

Change-Id: If8e721d9a55e4ed9d8df40ba3e9b3a2d3146f5fa
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoEliminate use of deprecated mockito methods 76/78876/2
Robert Varga [Wed, 19 Dec 2018 16:17:11 +0000 (17:17 +0100)]
Eliminate use of deprecated mockito methods

This is a combination of automated eclipse migration and manual
switch from anyObject() to any().

Change-Id: I6b8d64eeff3a10d83b5027407a63ed5968094731
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAvoid unnecessary unsuccessful AppendEntriesReply 05/78805/4
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>
5 years agoSpecify initial serialization buffer capacity for Payloads 33/78433/4
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 agoadd real "end-to-end" coverage in TracingBrokerTest 01/78801/4
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>
5 years agofix NPE in odl-mdsal-trace 00/78800/3
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>
5 years agoFix CSIT failure in MdsalLowLevelTestProvider 39/78839/2
Tom Pantelis [Mon, 17 Dec 2018 14:09:07 +0000 (09:09 -0500)]
Fix CSIT failure in MdsalLowLevelTestProvider

https://git.opendaylight.org/gerrit/#/c/78758/ modified
unsubscribeDtcl to return the "data-missing" error tag
if the DTCL received no notifications which is translated by
restconf to 404 but the CSIT test is expected 500 so return
"operation-failed".

Change-Id: I22df1012e9f191171699fb4ddee8353b22b24c14
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
5 years agoImprove error reporting in MdsalLowLevelTestProvider 58/78758/1
Tom Pantelis [Thu, 13 Dec 2018 15:10:23 +0000 (10:10 -0500)]
Improve error reporting in MdsalLowLevelTestProvider

Change-Id: Icdd86af5601f14d54b54354a1e0a3ffd4dc81653
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
5 years agoBump to triemap 1.0.1 35/78635/1
Stephen Kitt [Tue, 11 Dec 2018 08:49:27 +0000 (09:49 +0100)]
Bump to triemap 1.0.1

Change-Id: I5123c2e18e4cc1b11890d2d11417d1b16de21758
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoImprove timeout check error message 53/78453/3
Robert Varga [Wed, 5 Dec 2018 10:26:34 +0000 (11:26 +0100)]
Improve timeout check error message

Report the value being set in checkArgument.

Change-Id: I76e88504f794300634f61b293876e1677c549792
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRequire FiniteDuration in waitOnAsyncTask() 52/78452/2
Robert Varga [Wed, 5 Dec 2018 10:20:21 +0000 (11:20 +0100)]
Require FiniteDuration in waitOnAsyncTask()

We do not want tests to ever specify an infite duration, make sure
we express that in the contract.

Change-Id: If0202e6b81761461e0d34ad6a00ea207f8a28e50
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agogetShardTransactionIdleTimeout() is always FiniteDuration 51/78451/2
Robert Varga [Wed, 5 Dec 2018 10:17:44 +0000 (11:17 +0100)]
getShardTransactionIdleTimeout() is always FiniteDuration

Since we are always creating a finite duration, it does not make
sense to hide this fact.

Change-Id: I26fa6356c54816400e23fee5b07e8e65c5f3fc17
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRequire FiniteDuration in Actor props 50/78450/3
Robert Varga [Wed, 5 Dec 2018 10:10:42 +0000 (11:10 +0100)]
Require FiniteDuration in Actor props

All callers are using FiniteDuration and we really do not want
to have an infinite receive timeout. Require FiniteDuration
to be specified.

Change-Id: Ia4664dd2a1fea76ee4c42641ef132d6d47c78385
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoReduce use of scala.concurrent.duration.Duration 49/78449/2
Robert Varga [Wed, 5 Dec 2018 10:05:49 +0000 (11:05 +0100)]
Reduce use of scala.concurrent.duration.Duration

In most of the places we really are talking about a FiniteDuration,
hence use that class directly where it is an internal detail. Aside
from providing clarity, this also reduces potential confusion
with java.time.Duration.

Change-Id: I57d84c5ca058cfc6fa56ce57ebb0c8d4d3864a3a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate to java.time.Duration 74/75374/41
Robert Varga [Wed, 22 Aug 2018 10:26:35 +0000 (12:26 +0200)]
Migrate to java.time.Duration

Akka 2.5.12 deprecated quite a few methods using Scala duration
to use java.time.Duration. Migrate ourselves.

Change-Id: Ieb92c219f529c5d2c606016d3ea717d4531dda1b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAlways save to local copy in IdIntsListener 47/78347/2
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>
5 years agoAdd specific serializer for SimpleReplicatedLogEntry 90/78390/3
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>
5 years agoUse SharedSingletonMapTemplate 18/78118/6
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 96/78096/8
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 to yangtools-2.1.4 and mdsal-3.0.2 10/77610/10
Robert Varga [Thu, 8 Nov 2018 09:46:20 +0000 (10:46 +0100)]
Bump to yangtools-2.1.4 and mdsal-3.0.2

This bumps the dependencies to 2.1.4 and 3.0.2, respectively.

Change-Id: Ia24de2f5374257cfe36d0a6bca31a84af2c8daff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoImprove failure reporting in IdIntsListener 23/78323/2
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>
5 years agoImprove error reporting in WriteTransactionsHandler 11/78311/2
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>
5 years agoForward CloseTransactionChain messages to the leader 15/78215/4
Robert Varga [Tue, 27 Nov 2018 16:03:21 +0000 (17:03 +0100)]
Forward CloseTransactionChain messages to the leader

The frontend broadcasts this message to all shards leaders,
but it may end up being misrouted. Make sure we forward the
request to the current leader.

JIRA: CONTROLLER-1628
Change-Id: I8b743c8ea9f4f4467878016dfed8b2ad459309f0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMake ShardDataTree.insertEntryStatic 28/78228/2
Robert Varga [Tue, 27 Nov 2018 21:04:40 +0000 (22:04 +0100)]
Make ShardDataTree.insertEntryStatic

Eclipse points out this can be static, make it so.

Change-Id: Ia3243dc4e02157c2365895bb082e8f9ea6aa6a25
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agotell-based - reconnect on leader change 29/78029/5
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>
5 years agoDo not depend on controller APIs 95/78195/3
Robert Varga [Tue, 27 Nov 2018 08:21:12 +0000 (09:21 +0100)]
Do not depend on controller APIs

dsbenchmark is no longer using them, stop depending on them.

Change-Id: I853b99d69b2d47937e73e5ae5544f6b5baa6b7f1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate ntfbenchmark to MDSAL APIs 94/78194/3
Robert Varga [Tue, 27 Nov 2018 08:19:09 +0000 (09:19 +0100)]
Migrate ntfbenchmark to MDSAL APIs

This is a trivial conversion to switch away from controller APIs.

Change-Id: I2bd98524b02d975ffb677d9718642cadcd7aa43c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUse explicit classes for Listener forwarding 08/78208/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 agoSkip deployment to top-level aggregator 72/78172/1
Robert Varga [Mon, 26 Nov 2018 20:41:32 +0000 (21:41 +0100)]
Skip deployment to top-level aggregator

This pom is useful only during build, do not install/deploy it.

Change-Id: I028db508d5138152d76ca72cf2ebd3fb1ef4c228
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRecognize aggregated sonar reports 71/78171/1
Robert Varga [Mon, 26 Nov 2018 20:40:12 +0000 (21:40 +0100)]
Recognize aggregated sonar reports

This adds the necessary build support to aggregate jacoco reports,
so sonar can pick them up.

Change-Id: I345c449cb5a027ed043171659e74c74d93e5b223
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUse pre-sized ImmutableLists for yang-data-api 17/78117/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>
5 years agoProxy MD-SAL interfaces in DOMMountPointServiceImpl 80/77580/16
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>
5 years agoUse Method.getParameterCount() 77/77877/2
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 agoIntroduce ReadTransaction.exists() 67/77767/3
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>
5 years agoFix DOMDataReadTransaction javadoc 68/77768/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>
5 years agoProxy controller services in DOMMountPointServiceImpl 62/77562/18
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>
5 years agoRemove LegacyShardedDOMDataBrokerAdapterUtils 85/77585/4
Robert Varga [Wed, 7 Nov 2018 17:50:55 +0000 (18:50 +0100)]
Remove LegacyShardedDOMDataBrokerAdapterUtils

LogicalDatastoreType.toMdsal() renders this utility class useless,
remove it.

Change-Id: I0bf6e66f83338fff7d2ab7e54be10a56398c44dc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove DOMMountPointServiceImpl.registerMountPoint() 82/77582/7
Robert Varga [Wed, 7 Nov 2018 12:58:13 +0000 (13:58 +0100)]
Remove DOMMountPointServiceImpl.registerMountPoint()

This method is a leak and was deprecated in Fluorine, remove it.

Change-Id: I46e2a0eaa1d8baef5c35b6664daa0c606b7ad401
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump operation timeout to 500ms 08/77608/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 agoSimplify DTCL registration support classes 02/77602/2
Jakub Morvay [Wed, 7 Nov 2018 18:48:16 +0000 (19:48 +0100)]
Simplify DTCL registration support classes

Historically, there was support for registration of both
data tree change listeners and data change listeners. Common
infrastructure interfaces, abstract and generic classes were introduced,
since registration of both listener types required similar steps.

Data change listeners were deprecated and removed so there is no need
for this common infrastructure anymore. Get rid of unnecessary
interfaces, abstract classes and type variables. Now they just add
complexity to the code.

Change-Id: Ie2ce510bb5b49b892bcf8e5c562c96ea8345418e
Signed-off-by: Jakub Morvay <jmorvay@frinx.io>
5 years agoFix javadoc formatting 04/77604/1
Jakub Morvay [Thu, 8 Nov 2018 08:16:22 +0000 (09:16 +0100)]
Fix javadoc formatting

This fixes javadoc formatting in LeaderLocalDelegateFactory abstract
class.

Change-Id: I94390bc91b7d534426adebd71bb92726de1890cf
Signed-off-by: Jakub Morvay <jmorvay@frinx.io>
5 years agoHide DOMMountPointServiceImpl.registerMountPoint implementation 77/77577/2
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>
5 years agoForce UntrustedXML to be initialized from activator 98/77298/1
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>
(cherry picked from commit 978ef9d2ccbbaf4e54aa43109f7af21603226516)

5 years agoIntegrate MRI projects for Neon 55/74855/74
Robert Varga [Mon, 6 Aug 2018 13:27:49 +0000 (15:27 +0200)]
Integrate MRI projects for Neon

This patch bumps:
- odlparent to 4.0.2
- yangtools to 2.1.2
- mdsal to 3.0.1

It also deals with:
- DOMRpcError.getErrors() changing
- java.util.Optional being used in MD-SAL
- xmlunit upgrade via xmlunit-legacy
- any(Class) not matching nulls
- lists disappearing and hence requiring at least one item
- remove explicit <null/> in blueprints, as that breaks blueprint-core
- adjust sal-binding-it to include byte-buddy, which is a mockito dependency
- adjust dependencies to account for ietf-{inet,yang}-types movement
- moving to tech.pantheon.triemap
- mdsal.common.api removals

JIRA: CONTROLLER-1860
Change-Id: I31b2d011015846537a99f963ded1d38e7b29d71e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUpdate procedure to restart controller on quarantined condition. 10/77010/1
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>
5 years agoRemove the use of ActorIdentity.getRef() 25/76825/1
Robert Varga [Wed, 10 Oct 2018 15:13:42 +0000 (17:13 +0200)]
Remove the use of ActorIdentity.getRef()

This method has been replaced with getActorRef(), which returns
an Optional.

Change-Id: I41e4c8f8ed06de87716c06077201287752c0e327
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove use of Class.newInstance() 03/76803/3
Robert Varga [Tue, 9 Oct 2018 15:10:33 +0000 (17:10 +0200)]
Remove use of Class.newInstance()

This method is deprecated in JDK9+, migrate to its replacement.
This also means that any exceptions thrown are wrapped in
InvocationTargetException, hence we can (and are forced by FindBugs)
replace catching of Exception with catching of ClassCastException
and ReflectiveOperationException.

Change-Id: Iefd48ecef653fc73f74b2a77ac1ab7891b2575d3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agomove trace impl-blueprint.xml DI into TraceBindingBrokerWiring 61/72661/8
Michael Vorburger [Mon, 4 Jun 2018 14:18:49 +0000 (16:18 +0200)]
move trace impl-blueprint.xml DI into TraceBindingBrokerWiring

JIRA: CONTROLLER-1831
Change-Id: I1621e94c43fd5ddef4f1697cf7b87422e7ce0e5b
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
5 years agomove binding-broker.xml DI into BindingBrokerWiring 85/72485/12
Michael Vorburger [Wed, 30 May 2018 12:39:21 +0000 (14:39 +0200)]
move binding-broker.xml DI into BindingBrokerWiring

JIRA: CONTROLLER-1831
Change-Id: I5fdc4f9018276db92ba9ae2eb35688d428383411
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
5 years agoConvert blueprint ext classes to MDSAL APIs 16/76416/3
Tom Pantelis [Mon, 24 Sep 2018 14:45:18 +0000 (10:45 -0400)]
Convert blueprint ext classes to MDSAL APIs

All classes are now converted except for RoutedRpcMetadata as there
is no equivalent to the RoutedRpcRegistration in the MDSAL API.

Change-Id: If7720ad6dca5c281ae6c7ace50a60f3e7463f938
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
5 years agoMove commit payload propagation 65/76565/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>
5 years agoCorrect exception handling in LegacyDOMDataBrokerAdapter 24/76524/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() 23/76523/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>
(cherry picked from commit bc83a3eb1d1bd51865f97bfb4262716fe7841293)

5 years agoBump to Dropwizard Metrics 4.0.3 38/76438/1
Stephen Kitt [Tue, 25 Sep 2018 10:24:24 +0000 (12:24 +0200)]
Bump to Dropwizard Metrics 4.0.3

This also cleans up some duplicate dependencies.

Release notes:
* 4.0.0: https://metrics.dropwizard.io/4.0.0/about/release-notes.html
* 4.0.1: https://github.com/dropwizard/metrics/releases/tag/v4.0.1
* 4.0.2: https://github.com/dropwizard/metrics/releases/tag/v4.0.1
* 4.0.3: none available, see
  https://github.com/dropwizard/metrics/compare/v4.0.2...v4.0.3

Change-Id: I29050a587aebafcf0d169425242b6281dbb43519
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoConstruct IMDS delegate with proper type 66/76266/2
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>
(cherry picked from commit 0425ce4501aec2d8f96d6379baa1116a5350fba2)

5 years agoMigrate controller docs to the controller project 71/75871/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 70/75870/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>