controller.git
3 years agoBump versions by x.y.(z+1) 16/92216/1 stable/sodium
jenkins-releng [Fri, 21 Aug 2020 07:23:30 +0000 (07:23 +0000)]
Bump versions by x.y.(z+1)

Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
Change-Id: Idf3b69b354472f05a65048b6e088d9d95261a20f

3 years agoBump odlparent/yangtools/mdsal to 5.0.11/3.0.16/4.0.17 55/90555/11
Robert Varga [Mon, 22 Jun 2020 11:07:11 +0000 (13:07 +0200)]
Bump odlparent/yangtools/mdsal to 5.0.11/3.0.16/4.0.17

This picks up latest upgrades.

Change-Id: If76c7ef8ed3765716235c4b25caa047893a53109
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoDo not fail on warnings for docs-linkcheck 47/91447/1
Thanh Ha [Fri, 10 Jul 2020 14:57:46 +0000 (10:57 -0400)]
Do not fail on warnings for docs-linkcheck

This is a workaround due to sphinx-tabs being incompatible with the
Sphinx linkchecker which throws a warning. We mainly use linkchecker
to catch broken links so we don't really need to fail on warnings as
the main "docs" builder will still fail for warning level issues so
this is a reasonable workaround.

Signed-off-by: Thanh Ha <zxiiro@gmail.com>
Change-Id: If3e7cea79528ed31fadcea7c7a4c4e13315d1fcd

3 years agoDo not deploy opendaylight/model pom 61/91061/1
Robert Varga [Fri, 10 Jul 2020 09:14:54 +0000 (11:14 +0200)]
Do not deploy opendaylight/model pom

This is a pure aggregator, make sure we do not publish it.

Change-Id: Icf98fe8b67c1ad3923e78b1aa9bb7e644f78360b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix intermittent IT hangs 58/91058/1
Robert Varga [Fri, 10 Jul 2020 06:38:22 +0000 (08:38 +0200)]
Fix intermittent IT hangs

Integration tests may hang due to pax-exam/surefire interaction.
Switch to TCP communication channel to fix these.

Change-Id: Ic4713ff63b073fdf03b8ee072d5a4ccaa20bf48e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoEnable overwrite test suite 76/90776/2
Robert Varga [Thu, 25 Jun 2020 16:57:34 +0000 (18:57 +0200)]
Enable overwrite test suite

With data being split up correctly between shards, we can re-enable
the test suite for snapshot triggers.

JIRA: CONTROLLER-1913
JIRA: CONTROLLER-1950
Change-Id: Ibda02648682aee03cf4c5a0275f705d79dbe6b1c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit b21572e7fcdc926c7839f2b936eb3f623304fd6c)

3 years agoSplit modifications on datastore root 75/90775/2
Robert Varga [Thu, 25 Jun 2020 14:31:24 +0000 (16:31 +0200)]
Split modifications on datastore root

When we are dealing with modifications, we must not assume they are
not spanning shards. Specifically, we need to make sure we split
data when the user is targeting datastore root, as for those cases
we need to split top-level containers to their appropriate shards,
not the default shard.

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

3 years agoSimplify LocalTransactionContext 56/90756/5
Stephen Kitt [Fri, 26 Jun 2020 09:31:19 +0000 (11:31 +0200)]
Simplify LocalTransactionContext

... by reverting to a variant of the previous executeModification()
implementation.

Change-Id: I9a0480868bce2682e4ecc0e635a4db9f897d8511
Signed-off-by: Stephen Kitt <skitt@redhat.com>
(cherry picked from commit a70cc70f49501749ca4f6139080b0899b6b6e6f8)

3 years agoRefactor TransactionContext.executeModification() 55/90755/5
Robert Varga [Thu, 25 Jun 2020 19:21:07 +0000 (21:21 +0200)]
Refactor TransactionContext.executeModification()

Shift allocation of modification objects to RemoteTransactionContext,
so that local and noop cases do not end up allocating remoting objects.

JIRA: CONTROLLER-1951
Change-Id: Iedddb54aa9e55ca0e4352ecb176077a25ef643f3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 5b69c8e66b12a29a36457955cac4a45affd7c73f)

3 years agoSplit TransactionChainProxy.combineWithPriorReadOnlyTxFutures() 58/90758/3
Robert Varga [Thu, 25 Jun 2020 21:35:55 +0000 (23:35 +0200)]
Split TransactionChainProxy.combineWithPriorReadOnlyTxFutures()

There is a common and uncommon path here, where we expect majority
of high-performance uses to short-circuit to no combining at all.

Split that simple case out, so that we aid JIT inlining and also
know in profiling runs which branches are usually taken.

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

3 years agoAdd a missing space 57/90757/2
Robert Varga [Fri, 26 Jun 2020 10:43:50 +0000 (12:43 +0200)]
Add a missing space

Logging message was missing a space here, fix that up.

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

3 years agoMove checking/logging out of executeModification() 06/90706/3
Robert Varga [Thu, 25 Jun 2020 13:58:43 +0000 (15:58 +0200)]
Move checking/logging out of executeModification()

We will need specialized methods to deal with modifications,
similar to what we are doing for read(). As a first step, split
out common bits. This inlining has the added benefit of not touching
class reflection data.

JIRA: CONTROLLER-1950
Change-Id: I88030331ad8fe9299e8e824e18571047c87c90c6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 576924996622ae1d4326363830001d529882a431)

3 years agoClean up TransactionProxy a bit 05/90705/3
Robert Varga [Thu, 25 Jun 2020 13:53:30 +0000 (15:53 +0200)]
Clean up TransactionProxy a bit

An extra space and a superfluous else block.

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

3 years agoFix NoSuchElementException in toString() 34/90734/1
Robert Varga [Fri, 26 Jun 2020 10:33:43 +0000 (12:33 +0200)]
Fix NoSuchElementException in toString()

Original patch missed the fact that an empty set will throw, fix
that up.

Change-Id: I2d0588ec0499475935d285b3be6db299a9d4d525
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd an option to trigger snapshot creation on root overwrites 25/90625/2
Tibor Král [Fri, 21 Feb 2020 13:57:41 +0000 (14:57 +0100)]
Add an option to trigger snapshot creation on root overwrites

In some cases (such as DAEXIM import), it does not necessarily
make sense to retain previous data in the journal, as all of it
has been superseded.

JIRA: CONTROLLER-1913
Change-Id: I5d634faac06e6764a417c23e88c728373b900924
Signed-off-by: Tibor Král <tibor.kral@pantheon.tech>
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
(cherry picked from commit bb248f15d352cdd69e53ff7756fcb2c62cdc3eac)

3 years agoAdd option to disable default ActorSystemQuarantinedEvent handling 89/90389/6
Tibor Král [Thu, 11 Jun 2020 08:28:55 +0000 (10:28 +0200)]
Add option to disable default ActorSystemQuarantinedEvent handling

The default reaction to ThisActorSystemQuarantinedEvent is to
restart the entire Karaf container. However some users may want
to process the event differently.

JIRA: CONTROLLER-1949
Change-Id: Id65d31749dd97cb067611f7cfe4df76a6fe12204
Signed-off-by: Tibor Král <tibor.kral@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd UnsignedLongRangeSet.toString() 79/90479/1
Robert Varga [Mon, 15 Jun 2020 09:17:31 +0000 (11:17 +0200)]
Add UnsignedLongRangeSet.toString()

This makes the rangeset a wee bit more useful for debugging purposes.

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

3 years agoApply a workaround for the isolation of quarantined node 77/90477/1
Tejas Nevrekar [Thu, 4 Jun 2020 12:44:23 +0000 (18:14 +0530)]
Apply a workaround for the isolation of quarantined node

Listen to the AssociationErrorEvent in addition to
the ThisActorSystemQuarantinedEvent so that in cases
like isolate followed by unisolate, the quarantine
restart is triggered.

JIRA: CONTROLLER-1941
Change-Id: I937a9411c90fbbbaad73769efbc4e996369448a8
Signed-off-by: Tejas Nevrekar <tejas.nevrekar@gmail.com>
(cherry picked from commit 0df6660a561209abca5f54bc265d5b1e52ad91d5)

3 years agoAdd sender actor to the ForwardingDataTreeChangeListener 90/90290/3
Tibor Král [Thu, 4 Jun 2020 16:50:51 +0000 (18:50 +0200)]
Add sender actor to the ForwardingDataTreeChangeListener

The ForwardingDataTreeChangeListener is created when a shard
registers new listener. It then sends dataTreeChanges to said listener
but doesn't specify the sender. The RootListenerActor however needs
to know which shard produced the DataTreeChanged message.

Signed-off-by: Tibor Král <tibor.kral@pantheon.tech>
Change-Id: I4971cfaefa10c3136e0ddcc350ec7e00e68e6b42

3 years agoAllow incremental recovery 42/90442/1
Tibor Král [Wed, 22 Jan 2020 11:53:41 +0000 (12:53 +0100)]
Allow incremental recovery

Expose configuration knob in DatastoreContext to specify the
amount of recovered journal entries after which a Snapshot should
be taken and the journal purged.

JIRA: CONTROLLER-1915
Change-Id: I4b20a0abe0329965ca5ac1ab5df7d9ca8480cfb2
Signed-off-by: Tibor Král <tibor.kral@pantheon.tech>
(cherry picked from commit 33877f41ffc3f8eb36ad8490315419b90817d26e)

3 years agoFix OpsManager registry instantiation 91/89991/1
Robert Varga [Wed, 3 Jun 2020 13:51:54 +0000 (15:51 +0200)]
Fix OpsManager registry instantiation

We have a day-zero bug with actions, as OpsManager ends up
instantiating the wrong actor -- hence we have two RpcRegistry
instances and no ActionRegistry instances.

JIRA: CONTROLLER-1943
Change-Id: I3b374454af3225cf13d5e23e4fb6744bf3f9ed99
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump versions by x.y.(z+1) 45/90045/1
jenkins-releng [Thu, 28 May 2020 23:43:57 +0000 (23:43 +0000)]
Bump versions by x.y.(z+1)

Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
Change-Id: I2845c1dbc318e857fb8dc223cc95a267b12a0bbe

3 years agoAdd documentation about per-shard settings 89/89889/2
Robert Varga [Mon, 25 May 2020 17:44:44 +0000 (19:44 +0200)]
Add documentation about per-shard settings

Previous implementation of per-shard datastore properties did not
document this ability. Make sure we document it and properly test it.

JIRA: CONTROLLER-911
Change-Id: I5be13c73e76e612a93620710e6a00b78d9dee216
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd tests for new RootDataTreeChangeListenerProxy and Actor 87/89887/3
Tibor Král [Thu, 21 May 2020 16:27:08 +0000 (18:27 +0200)]
Add tests for new RootDataTreeChangeListenerProxy and Actor

Listening on root with multiple shards is not tested anywhere,
add some test coverage.

JIRA: CONTROLLER-1932
Change-Id: Ie0d94f2d9b90869a140b73d85f1696df712fad25
Signed-off-by: Tibor Král <tibor.kral@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 4152b84fbf3d8d5436467f96076c6fb6a0f2ae4a)

3 years agoDo not bump follower term while it is isolated 82/89882/1
Tomas Cere [Fri, 22 May 2020 11:11:04 +0000 (13:11 +0200)]
Do not bump follower term while it is isolated

When a follower gets into a state that its isolated(ie cannot reach either peer)
it starts bumping its term every election timeout. Once the cluster heals it
would then disrupt the cluster because it has a higher term then the healthy part.
We can avoid this by not triggering new elections on followers that cannot
reach other peers while they are unreachable.

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

3 years agoAdd support for root DTCL listening on all shards in DS 79/89879/2
Robert Varga [Tue, 19 May 2020 14:37:47 +0000 (16:37 +0200)]
Add support for root DTCL listening on all shards in DS

Devide DTCLProxy into DTCLSingleShardProxy, DTCLMultiShardProxy and
DTCLPrefixShardProxy to address the different registration mechanisms
used in all three cases.

JIRA: CONTROLLER-1932
Change-Id: I48732577f26fa5844b69a2feaddb02fe53909da7
Signed-off-by: Tibor Král <tibor.kral@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix DeleteEntries persisting with wrong index 74/89874/1
tadei.bilan [Tue, 12 May 2020 14:03:37 +0000 (17:03 +0300)]
Fix DeleteEntries persisting with wrong index

During persisting we delete entries, so in case of persisting DeleteEntries with adjusted index,
 index is being adjusted twice, that results in additional entries being deleted during recovery.

JIRA: CONTROLLER-1934

Signed-off-by: tadei.bilan <tadei.bilan@pantheon.tech>
Change-Id: Ib326f02630281ed52982dab2f48c01503b791ef7
(cherry picked from commit 45481ba83a3f698f1127f15b02f4c5aaa4081ad5)

3 years agoBump odlparent/yangtools/mdsal to 5.0.7/3.0.11/4.0.14 01/89801/1
Robert Varga [Fri, 15 May 2020 05:24:39 +0000 (07:24 +0200)]
Bump odlparent/yangtools/mdsal to 5.0.7/3.0.11/4.0.14

This picks up latest upgrades.

Change-Id: I0af58d07f94fd6d520010588bd18624a755d4a74
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMigrate OSGI compendium reference 85/88785/1
Robert Varga [Thu, 2 Apr 2020 12:24:03 +0000 (14:24 +0200)]
Migrate OSGI compendium reference

OSGi R6 has moved the artifact declaration, make sure we do not use
the R5 one.

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

4 years agoSwitch current {ABI,DataStore,Payload}Version to Sodium SR1 78/88778/1
Robert Varga [Wed, 25 Sep 2019 14:25:08 +0000 (16:25 +0200)]
Switch current {ABI,DataStore,Payload}Version to Sodium SR1

This mass-switches versioned resources to use Sodium SR1 streaming
format.

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

4 years agoFixup "Leader should always apply modifications as local" regression 75/88375/3
Tomas Cere [Wed, 12 Feb 2020 12:23:22 +0000 (13:23 +0100)]
Fixup "Leader should always apply modifications as local" regression

This reintroduces the original commit:
 e66759266dc43d5f58b2837aca5047b42c205e4a
and fixes up the two bugs it introduced.

First one didn't account for the fact that the new leader might have not
tracked forwarded transactions from the previous leader which would
be ignored. Previously not tracked transactions are now applied
normally on the new leader.

Second issue was that we started keeping around deserialized
candidates in memory in each CommitTransactionPayload even after they
were applied and no longer needed.During the final use of the
candidate in ShardDataTree the candidate is now clearedduring
CommitTransactionPayload.acquireCandidate() which allows the
deserialized candidate to be cleared by GC.

JIRA: CONTROLLER-1927
JIRA: CONTROLLER-1928
Change-Id: I47876d4d29a8e9b6b9283d70e47108f3dc2ed3ee
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
4 years agoAllow programmatic module sharding configuration 52/87052/4
Tibor Král [Tue, 22 Oct 2019 16:24:21 +0000 (18:24 +0200)]
Allow programmatic module sharding configuration

Adds the option to create Configuration without the need for
module-shards.conf file. Current version only accepts a path
to the module-shards.conf. The file is later loaded and
deserialized into a Config object. This patch provides the
option to pass the Config object directly.

Change-Id: Ibeb666bd5f01d7ae972d26453046c959749a0656
Signed-off-by: Tibor Král <tibor.kral@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit b89c7ece8e827ce8d85b343f431d4fd974c90e32)

4 years agoDo not use passive connections 05/88305/1
Robert Varga [Mon, 16 Mar 2020 11:45:48 +0000 (12:45 +0100)]
Do not use passive connections

We are seeing issues with passive connections, pointing towards
switching them off (or migrate to Artery TCP, which is one-way).

As Artery TCP has memory leaks before 2.5.29, opt to disable passive
connections.

JIRA: AAA-195
Change-Id: Ia9779ad6a7d9d2bc73306d0968e5d22553450fac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 8da08c9f008d371c491cf6b35494ca36c2ebdcb9)

4 years agoBump odlparent/yangtools/mdsal to 5.0.6/3.0.10/4.0.13 47/88347/3
Robert Varga [Sat, 7 Mar 2020 06:42:04 +0000 (07:42 +0100)]
Bump odlparent/yangtools/mdsal to 5.0.6/3.0.10/4.0.13

This picks up latest upgrades, which necessitate a few fixes for
checkstyle violations as well as adjustment to comply with Akka API
changes.

Change-Id: I657f10eb8424944dce40c94bdfe81204a6f66116
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoExpose more fine-grained shutdown methods 56/87956/1
Robert Varga [Fri, 21 Feb 2020 05:28:55 +0000 (06:28 +0100)]
Expose more fine-grained shutdown methods

We want to the user to be in control of timing of shutdown, expose
appropriate methods to do that.

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

4 years agoPropagate TimeoutException when ActorSystem fails to terminate 53/87953/1
Tibor Král [Thu, 6 Feb 2020 11:19:42 +0000 (12:19 +0100)]
Propagate TimeoutException when ActorSystem fails to terminate

ActorSystemProviderImpl waits 10s for the ActorSystem to terminate.
If this timeout is reached propagate the resulting TimeoutException
so the caller knows something went wrong.

JIRA: CONTROLLER-1929
Change-Id: I6518600e2930e3a0a955215b24a9b3074730ff64
Signed-off-by: Tibor Král <tibor.kral@pantheon.tech>
(cherry picked from commit e8215aef8cf2475512d7601fdaebcb1294e93fc7)

4 years agoBump versions by x.y.(z+1) 97/87597/1
jenkins-releng [Wed, 12 Feb 2020 02:32:15 +0000 (02:32 +0000)]
Bump versions by x.y.(z+1)

Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
Change-Id: I0baef650865d816b4c42b5ae88d99646ebb6b68e

4 years agoRevert "Leader should always apply modifications as local" 77/87277/2
Luis Gomez [Wed, 29 Jan 2020 17:04:09 +0000 (17:04 +0000)]
Revert "Leader should always apply modifications as local"

This reverts commit 8b74aa768b59009b9f78c938181dbf8fd2723cc3, which
broke both upgrade-recovery and pre-leader entry application. We
will re-visit the patch and try again.

JIRA: CONTROLLER-1927
JIRA: CONTROLLER-1928
Change-Id: I23e4264cf6a20e9d2369d44005c31db1ef7635c9
Signed-off-by: Luis Gomez <ecelgp@gmail.com>
4 years agoLeader should always apply modifications as local 43/87043/2
Tomas Cere [Tue, 18 Jun 2019 12:54:56 +0000 (14:54 +0200)]
Leader should always apply modifications as local

Normally an entry application is as follows:
1. leader sends an append entry off to persistence and replicates it to
   followers
2. leaders creates its ClientRequestTracker
3. when the entry is done with persistence and replication leader moves its
   commit index
4. part of moving the commit index is sending an ApplyState message which
   finalizes the entry application in the DataTree
5. The ApplyState determines if a ClientRequestTracker is present and adds
   an identifier to the ApplyState message if it is. This determines the way
   in which the finalize of the entry application happens in the DataTree.
   If it is present the entry is applied as if it originated on the leader,
   if it is not present it is applied as if the node is a follower.

The problem is when the leader flaps in a leader -> follower -> leader
transition after 2. and before 4..

This would mean that the new leader no longer has the ClientRequestTracker
which was created in the previous leader state, which means that when it
starts with 5. it will create the ApplyState without an identifier
and the entry finishes up the application as if the node is a follower.

This means that it will be applied without finishCommit which means that
the transaction will be forever stuck in COMMIT_PENDING state until
the node would be restarted.

Change this up, so that the leader will apply modifications as local, even
when it looses its ClientRequestTracker and add Identifiable to payloads
which require it.

Since this code path should never occur when we are candidate, catch this
transition. As ClientRequestTracker becomes an optional entity, we hide that
as well.

JIRA: CONTROLLER-1927
Change-Id: I636f998cd62ec82ef02193261624e4a51275fb86
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 9b319f491af1c65705b69e8a182aab5006a2f959)

4 years agoBump to odlparent-5.0.5/yangtools-3.0.9/mdsal-4.0.11 24/86924/3
Robert Varga [Wed, 15 Jan 2020 13:17:10 +0000 (14:17 +0100)]
Bump to odlparent-5.0.5/yangtools-3.0.9/mdsal-4.0.11

Pick up latest fixes.

Change-Id: I6e46d8e65fe7d44ac7005451e533c45196116962
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove unneeded checkstyle suppression 89/86689/1
Robert Varga [Fri, 3 Jan 2020 12:44:17 +0000 (13:44 +0100)]
Remove unneeded checkstyle suppression

We are not catching anything here, remove the suppression.

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

4 years agoRemove jsr173-ri from dependencies 81/86481/1
Robert Varga [Wed, 18 Dec 2019 11:09:46 +0000 (12:09 +0100)]
Remove jsr173-ri from dependencies

JSR173 is part of JRE, hence there is no point to inherit this
dependency. It also helps to have our releases consumable from
Central (which does not carry the .jar).

Change-Id: I3cd50c6f20149e48c1946c0ea50a3a8e57f847b1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump odlparent/yangtools/mdsal to 5.0.4/3.0.7/4.0.8 63/86363/2
Robert Varga [Wed, 11 Dec 2019 23:54:59 +0000 (00:54 +0100)]
Bump odlparent/yangtools/mdsal to 5.0.4/3.0.7/4.0.8

Pick up the latest upgrades and fixes.

Change-Id: Id4c1f68515ff8c8caa97d525056b9c9a39382709
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBail faster on not found module 30/86030/1
Robert Varga [Tue, 26 Nov 2019 14:31:49 +0000 (15:31 +0100)]
Bail faster on not found module

If we fail to find config for a particular module, we can bail
directly without going through another empty check.

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

4 years agoAdd javadoc links to yangtools-docs and mdsal-docs 97/85897/1
Robert Varga [Wed, 20 Nov 2019 08:14:27 +0000 (09:14 +0100)]
Add javadoc links to yangtools-docs and mdsal-docs

Cross reference controller-docs with upstreams.

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

4 years agoAllow shard settle timeout to be tuned 93/85893/1
Tibor Král [Mon, 11 Nov 2019 17:23:31 +0000 (18:23 +0100)]
Allow shard settle timeout to be tuned

When we are starting the datastore, we wait up to a fixed number of
election timeout intervals (3) for shards to finish electing a leader.

This is not always enough, especially if recovery takes a long time,
hence introduce shardLeaderElectionTimeoutMultiplier to make this
tunable.

JIRA: CONTROLLER-1914
Change-Id: Iba1d116d0248fc6046aeeae3ec30ecac50f373c9
Signed-off-by: Tibor Král <tibor.kral@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit b65f82f3c6e6e4c53ea2efa4dba30ddf82d61616)

4 years agoBump to odlparent-5.0.3/yangtools-3.0.6/mdsal-4.0.7 10/85510/2
Robert Varga [Sun, 3 Nov 2019 07:31:29 +0000 (08:31 +0100)]
Bump to odlparent-5.0.3/yangtools-3.0.6/mdsal-4.0.7

This picks up latest upgrades and fixes.

Change-Id: I5e4d4536f156b55d2d1288820814c3b4297fd58c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMove DataTreeCandidate extraction to where it is applied 64/85564/2
Robert Varga [Wed, 5 Jun 2019 10:45:15 +0000 (12:45 +0200)]
Move DataTreeCandidate extraction to where it is applied

This patch just moves the code that is extracting the candidate
from payload into the same method that is going to apply it, giving
us an opportunity to merge the two interfaces.

JIRA: CONTROLLER-1889
Change-Id: I44a5e2f7181147dca9377d0a9516bbe6b3ba85e3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 67c6623cebe8f1d735df90eccc85fd223e6c021f)

4 years agoRework AbstractNormalizedNodePruner 63/85563/1
Robert Varga [Tue, 14 May 2019 08:15:19 +0000 (10:15 +0200)]
Rework AbstractNormalizedNodePruner

This refactors NormalizedNodePruner to use
ReusableImmutableNormalizedNodeStreamWriter for creation of the
actual NormalizedNode tree.

It simplifies the implementation and allows the reuse of minor
optimizations like LeafInterner.

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

4 years agoAllow AbstractClientActor generation to start from non-zero 07/85507/3
Robert Varga [Fri, 25 Oct 2019 13:50:59 +0000 (15:50 +0200)]
Allow AbstractClientActor generation to start from non-zero

This adds the ability to override the initial generation seeded
into persistence. The requested generation is controlled via
system properties on a per-client-type basis:

org.opendaylight.controller.cluster.access.client.initial.generation.datastore-operational = 500

This is useful during bringup of a zombie node, which lost all
of its persistence, for example during recovery from backup.

JIRA: CONTROLLER-1626
Change-Id: If32487fedcb5b6b39551a3359c069df940a6a725
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 2be60a19ed99fe7d33a24f7db8af3510f7ea835f)

4 years agoAdd the ability to report known connected clients 06/85506/3
Robert Varga [Thu, 24 Oct 2019 11:54:38 +0000 (13:54 +0200)]
Add the ability to report known connected clients

In order to allow from-scratch recovery, we need the ability to
query all existing shards to provide the identifiers of clients
they know about. This patch adds the models to support such a query
as well as implementing it in cluster-admin.

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

4 years agoAdd locate-shard RPC 05/85505/2
Robert Varga [Thu, 10 Oct 2019 13:36:42 +0000 (15:36 +0200)]
Add locate-shard RPC

This adds the ability to query what is the preferred node to talk
to a particular shard.

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

4 years agoCleanup cluster-admin.yang 02/85502/1
Robert Varga [Thu, 10 Oct 2019 11:08:00 +0000 (13:08 +0200)]
Cleanup cluster-admin.yang

We are redefining the same leaves over and over, make sure we
define them in a grouping for common definition. Also ensure
shard name requires at least one character -- just as we expect
it to happen in the implementation.

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

4 years agoUse ConcurrentHashMap.newKeySet() 82/85182/2
Robert Varga [Wed, 16 Oct 2019 11:51:16 +0000 (13:51 +0200)]
Use ConcurrentHashMap.newKeySet()

Instead of using Sets.newConcurrentHashSet(), use the utility
method provided by ConcurrentHashMap.

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

4 years agoRemove unneeded version declaration 83/85183/2
Robert Varga [Wed, 16 Oct 2019 12:01:45 +0000 (14:01 +0200)]
Remove unneeded version declaration

The model is properly exposed from artifacts, do not override the
managed version.

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

4 years agoRemove unused model imports 52/85352/2
Robert Varga [Wed, 23 Oct 2019 09:07:24 +0000 (11:07 +0200)]
Remove unused model imports

pyang is pointing out these imports as unused, fix them up.

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

4 years agoBump versions by x.y.(z+1) 64/85464/1
jenkins-releng [Fri, 1 Nov 2019 06:04:48 +0000 (06:04 +0000)]
Bump versions by x.y.(z+1)

Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
Change-Id: I132cdbb15d6325ee5c7c48eea8111c13bd2838c3

4 years agoUse careful byte-masking/shifting in Mg Input 98/85098/2
Robert Varga [Mon, 14 Oct 2019 08:16:02 +0000 (10:16 +0200)]
Use careful byte-masking/shifting in Mg Input

We really want to operate on byte and not int, the bytes are to
be treated as unsigned, which gets wrecked by sign extension.

Introduce an explicit mask(byte, byte) method and use it where
we are potentially sign-extending.

JIRA: CONTROLLER-1919
Change-Id: I0484f440c1589859fb268947f5a80a2b4969451e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDisable slf4j SSL link 86/85086/1
Robert Varga [Thu, 10 Oct 2019 18:59:08 +0000 (20:59 +0200)]
Disable slf4j SSL link

slf4j does not provide apidocs over TLS (WTF?!?!?!), link HTTP
site instead.

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

4 years agoRegister MXBean only during start 59/85059/1
Robert Varga [Fri, 11 Oct 2019 12:32:14 +0000 (14:32 +0200)]
Register MXBean only during start

We should not be registering resources until we are started, this
fixes an exception seen in Genius UT.

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

4 years agoSplit up transaction chunks 13/85013/1
Robert Varga [Thu, 19 Sep 2019 23:50:56 +0000 (01:50 +0200)]
Split up transaction chunks

This adds the infrastructure to prevent allocation of large byte[]s,
as when those exceed 0.5-16MiB, under G1GC they end up in humongous
object region. Not only that, but after some cut-off point, the
copying of arrays starts to dominate performance.

What we do here is ensure we always receive up to a configurable
number of bytes, defaults to 256KiB, and keep those chunks in a list.
This way we may end up with larger overhead, but that really is
neglibeble -- even a 2GiB payload would end up using only about
8K arrays.

While the input/output streams are similar to
org.apache.commons.io.output.ByteArrayOutputStream, the design here
is geared towards having the intermediate representation available
as well as devolving to a single byte[] for memory efficiency
reasons.

JIRA: CONTROLLER-1920
Change-Id: I2b79a633ebf4fdf8d68d2accc644326e30b41f22
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse ReusableNormalizedNodeReceiver 85/84985/1
Robert Varga [Fri, 27 Sep 2019 05:12:32 +0000 (07:12 +0200)]
Use ReusableNormalizedNodeReceiver

This simplifies some APIs by using ReusableStreamReceiver, as it
is an API-level construct rather than a particular implementation.

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

4 years agoFixup docs references 02/84802/1
Robert Varga [Fri, 27 Sep 2019 15:50:34 +0000 (17:50 +0200)]
Fixup docs references

This updates references very slightly, so that we do not have
outdated or unnecessary pointers.

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

4 years agoDo not update term from unreachable members 64/84764/1
Tomas Cere [Tue, 2 Jul 2019 07:58:13 +0000 (09:58 +0200)]
Do not update term from unreachable members

In case of a one way connection problem, a follower that cannot
receive messages but can send them, it will change into Candidate
and continuosly bump its term while it cannot receive any
RequestVoteReplies.

Since the messages it sends can actually get through, this means
that the healthy part of the cluster will have its leader dropped
every 2 election timeouts.

Change this up so we only update term when receiving a RequestVote
from a reachable node.

Change-Id: Ia8a0b59cfb2d0cd68096172a1d2d47f68e7ed473
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 7aaff9ef1da193ee421541db1a5b57a7cbf51fb2)

4 years agoDefine PayloadVersion.MAGNESIUM 37/84737/1
Robert Varga [Wed, 25 Sep 2019 10:45:18 +0000 (12:45 +0200)]
Define PayloadVersion.MAGNESIUM

This adds the PayloadVersion which uses Magnesium normalized node
stream.

JIRA: CONTROLLER-1919
Change-Id: Ie43e9932a19bd19c92f14890da13646bf56e2f6f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 422ac9fbe65c02f942c1fed41ff4aa96545f4224)

4 years agoDefine DataStoreVersions.MAGNESIUM_VERSION 36/84736/1
Robert Varga [Wed, 25 Sep 2019 10:38:17 +0000 (12:38 +0200)]
Define DataStoreVersions.MAGNESIUM_VERSION

This adds Magnesium version, which is using Magnesium normalized
node stream.

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

4 years agoAdd cds-access-api MAGNESIUM version 35/84735/1
Robert Varga [Wed, 25 Sep 2019 10:41:24 +0000 (12:41 +0200)]
Add cds-access-api MAGNESIUM version

This adds a new ABI version, which uses Magnesium normalized node
stream.

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

4 years agoDefine PayloadVersion.SODIUM_SR1 34/84734/1
Robert Varga [Wed, 25 Sep 2019 10:33:15 +0000 (12:33 +0200)]
Define PayloadVersion.SODIUM_SR1

This adds the PayloadVersion which uses Sodium SR1 normalized node
stream.

JIRA: CONTROLLER-1919
Change-Id: I3dfa6ea053ea356bb68b458f3d6787904b2904c0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 3f2f311927a45635339201f400652c145318e632)

4 years agoSwitch ABIVersion/DataStoreVersions back to Neon SR2 33/84733/1
Robert Varga [Wed, 25 Sep 2019 14:16:22 +0000 (16:16 +0200)]
Switch ABIVersion/DataStoreVersions back to Neon SR2

This switches the current versions for use back to Neon SR2, reverting
the rollout.

JIRA: CONTROLLER-1919
Change-Id: I57175fb26a86a1de589602bcec3b4c022ddf8a72
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 1710d6e45dad125fa3d13a774f2a1afb8749a91f)

4 years agoDefine DataStoreVersions.SODIUM_SR1_VERSION 32/84732/1
Robert Varga [Wed, 25 Sep 2019 10:24:39 +0000 (12:24 +0200)]
Define DataStoreVersions.SODIUM_SR1_VERSION

This adds Sodium SR1 version, which is using SodiumSR1 normalized
node stream.

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

4 years agoAdd cds-access-api SODIUM_SR1 version 31/84731/1
Robert Varga [Wed, 25 Sep 2019 10:18:29 +0000 (12:18 +0200)]
Add cds-access-api SODIUM_SR1 version

This adds a new ABI version, which uses SodiumSR1 normalized node
stream.

JIRA: CONTROLLER-1919
Change-Id: I457c2fcc7e10f4ba2021ce6ddb4fbc2adbfdd596
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 598f290a8c88342f16379842ab7e4915e9fcea6c)

4 years agoAdd Magnesium stream version 30/84730/1
Robert Varga [Wed, 25 Sep 2019 06:07:50 +0000 (08:07 +0200)]
Add Magnesium stream version

This is a variant of Sodium SR1 streaming format, which does not
allow presence of BigInteger tokens, as those values are superseded
by Uint64.

JIRA: CONTROLLER-1919
Change-Id: I1dc5c7376bf1ecf105e965e42d74806ed99ab9b1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 545a41e805a53f0e636e625cfa5aaa9262faeaac)

4 years agoAdd LithiumSR1 input/output support 29/84729/1
Robert Varga [Mon, 9 Sep 2019 08:29:57 +0000 (10:29 +0200)]
Add LithiumSR1 input/output support

This is a code drop of both DataInput and DataOutput for Sodium SR1
streaming format. It uses its own dedicated tokes, along with quite
a few of stateful encoding rules.

Where Lithium did encoding did not perform any look-behind except
for LeafSetEntryNodes and only maintained simple coding tables,
this coder maintains simple 'parent' state tracking.

While the state tracking is not mandated on the encoder side, some
amount of tracking is required in the decoder side to provide full
coverage of coding constructs.

Two examples of this are:
- parent QName references, which are expanded to cover not only
  LeafSet/LeafSetEntry, but also UnkeyedList/UnkeyedListEntry
  and most importantly Map/MapEntry pairs
- Map/MapEntry tracking is also important for coding leaf nodes
  which represent keys -- in those cases emitting the leaf value
  is superfluous, as it can be looked up from MapEntry's predicates

Also this state tracking is maintained on-stack, thus making issues
related with it nigh impossible (unlike the Lithium LeafSetEntry
bugs).

JIRA: CONTROLLER-1919
Change-Id: I5fcf85a76750301cd3f8bcbd505baa0f95397cb5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 43ab81083ba4ffdbf6999df1e6fe8750ce2c76ac)

4 years agoAdd Magnesium encoding tokens 28/84728/1
Robert Varga [Fri, 20 Sep 2019 08:07:10 +0000 (10:07 +0200)]
Add Magnesium encoding tokens

Changes to how uint8/16/32/64 types are mapped results in the need
to transfer the new value types. These represent 4 brand new tokens,
which need to be handled.

One option would be to fork NeonSR2 and modify it, somehow dealing
with value lookups (i.e. Uint8 is not valid in SR2 stream, but tokens
are shared across Lithium/NeonSR).

Another option is to create a streaming format from scratch, coming
up with a completely new family of tokens and encoding rules. This
is attractive, as both current formats have three deficiencies:

1) they encode MapEntry key values twice, once in the leaf itself
   and once in the entry's NodeIdentifierWithPredicates
2) they are '0-happy', i.e. they do not recognize that integer codes
   and sizes are typically much smaller than the 4-byte range and thus
   much of the stream is just small ints encoded as 4 bytes
3) while they are simple and straighforward, they also end up wasting
   bits -- the four token families (codes, value types, node types,
   path argument types) each have at most 15 distinct values, and
   hence the bytes used to transmit them have 4 empty bits (or more)

Hence we take the other option and design a streaming format with
brand new tokens, which are structured to carry as much more
information per byte.

This is done by combining 'type' information with forward coding
hints, for example:

- a Boolean leaf value would previously require 2 bytes:
    (byte)    ValueTypes.BOOL_TYPE
    (byte)    true/falseIn the new tokens
  whereas new tokens express this in one byte:
    (byte)    LeafValue.BOOLEAN_{FALSE,TRUE}
- a byte[5] value would require 10 bytes to encode:
    (byte)    ValueTypes.BINARY_TYPE
    (int)     length
    (5 bytes) bytes
  whereas new tokens express this in 6 bytes:
    (byte)    ValueTypes.BINARY_0 + 5 (works up to 127)
    (5 bytes) bytes

A similar approach is taken when encoding NormalizedNode types. Here
we recognize there are only 14 node types (currently) and hence we
can provide up to 4 additional bits for information about how the
node's identifier is encoded.

For PathArguments, we also use separate coding, where the format
is flexible based on the 4 types on identifiers there are, each
having slightly different format. Most notable here is the integration
of QName reference coding (for normal PathArguments) and integrated
set size coding (for AugmentationIdentifiers).

This this patch adds just the token definitions, along with basic
documentation and version declaration.

JIRA: CONTROLLER-1919
Change-Id: I9f6f58a7cb77d9d98c46e13b8dc6955c8e3c0737
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 95bd6c9c8254844616a99bf40f73b4d2c5726686)

4 years agoAdd an explicit namespace sharing test 96/84696/2
Robert Varga [Tue, 24 Sep 2019 13:16:15 +0000 (15:16 +0200)]
Add an explicit namespace sharing test

This adds a test to target QName/QNameModule/String reference
differentiation.

JIRA: CONTROLLER-1919
Change-Id: Iad736a81f627da4a04753b380acb530ccc8ba219
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 548d175b3ebb0bdefe6d5073f039aa18ccd0ad81)

4 years agoMove Neon SR2 tokens into its own class 27/84727/1
Robert Varga [Fri, 20 Sep 2019 17:42:15 +0000 (19:42 +0200)]
Move Neon SR2 tokens into its own class

Same as with base Lithium tokens, these can create confusion about
where they are used. Make sure we encapsulate them in their own
class, so no confusion ensues.

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

4 years agoRename ValueTypes to LithiumValue 26/84726/1
Robert Varga [Fri, 20 Sep 2019 17:59:04 +0000 (19:59 +0200)]
Rename ValueTypes to LithiumValue

These constants are only used in Lithium-based streams, make sure
we reflect that in the name of the class, so they do not end up
being confused.

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

4 years agoRename PathArgumentTypes to LithiumPathArgument 25/84725/1
Robert Varga [Fri, 20 Sep 2019 17:55:39 +0000 (19:55 +0200)]
Rename PathArgumentTypes to LithiumPathArgument

These tokens are only used in Lithium-based streams, but the global
name is slightly confusing. Rename to LithiumPathArgument, which
makes the context more obvious.

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

4 years agoRename NodeTypes to LithiumNode 24/84724/1
Robert Varga [Fri, 20 Sep 2019 17:54:04 +0000 (19:54 +0200)]
Rename NodeTypes to LithiumNode

This makes it clear these constants are only used in Lithium
encoding.

JIRA: CONTROLLER-1919
Change-Id: I1fb44f49d3409fdd007fe58dc6ce92b0eb6744b8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 53af8a1af8d2433788c9b9aa512930b57b19d297)

4 years agoMove Lithium tokens to their own class 23/84723/1
Robert Varga [Fri, 20 Sep 2019 17:36:10 +0000 (19:36 +0200)]
Move Lithium tokens to their own class

TokenTypes assumes singularity, which can create confusion, as we
have multiple multiple distinct sets. This separates out
Lithium-specific tokens into their own class.

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

4 years agoSuppress modernization 01/84601/3
Robert Varga [Tue, 20 Aug 2019 19:29:51 +0000 (21:29 +0200)]
Suppress modernization

Modernize as much as possible, but as we have legacy APIs in play,
we have to add also some suppressions.

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

4 years agoMigrate from YangInstanceIdentifier.EMPTY 00/84600/3
Robert Varga [Fri, 30 Aug 2019 09:10:53 +0000 (11:10 +0200)]
Migrate from YangInstanceIdentifier.EMPTY

This migrates to the replacement empty() method.

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

4 years agoMark historic DataStoreVersions deprecated 14/84714/2
Robert Varga [Wed, 25 Sep 2019 10:26:43 +0000 (12:26 +0200)]
Mark historic DataStoreVersions deprecated

We do not support anything before Boron, hence mark these constants
as deprecated.

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

4 years agoBump mdsal to 4.0.6 99/84599/3
Robert Varga [Fri, 13 Sep 2019 18:56:56 +0000 (20:56 +0200)]
Bump mdsal to 4.0.6

This picks up latest fixes.

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

4 years agoBump yangtools to 3.0.5 98/84598/3
Robert Varga [Fri, 13 Sep 2019 14:13:53 +0000 (16:13 +0200)]
Bump yangtools to 3.0.5

This picks up the latest fixes and improvements.

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

4 years agoBump odlparent to 5.0.2 97/84597/3
Robert Varga [Tue, 20 Aug 2019 13:59:12 +0000 (15:59 +0200)]
Bump odlparent to 5.0.2

This bumps odlparent to pick up latest references.

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

4 years agoUse explicit versioning in MetadataShardDataTreeSnapshot 17/84717/1
Robert Varga [Wed, 25 Sep 2019 13:39:28 +0000 (15:39 +0200)]
Use explicit versioning in MetadataShardDataTreeSnapshot

Rather than relying on the default version, make sure we use
whatever the version is defined for the message at hand.

JIRA: CONTROLLER-1919
Change-Id: Ic325ba93e5152570586f7a0baa8ce2abf8053c4e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 669a2b1087c9e793cb85ddf173f2c84840d05387)

4 years agoAdd more serialization assertions 81/84681/1
Robert Varga [Mon, 23 Sep 2019 06:23:29 +0000 (08:23 +0200)]
Add more serialization assertions

This adds a few more assertions to ensure our serialization format
does not move without us knowing.

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

4 years agoAdd a 100K-entry test 62/84662/2
Robert Varga [Thu, 19 Sep 2019 21:59:24 +0000 (23:59 +0200)]
Add a 100K-entry test

This adds a test for serialization of a Map of 100K entries,
each of which has the key leaf and a simple constant non-key leaf.
Unlike other tests, this quantifies how well the encoding works
when faced with large maps.

JIRA: CONTROLLER-1919
Change-Id: I306e5175ba595a0967432393766f8317e7205492
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 468373b62341066eda6abcabe21e0e4ce86b4cc3)

4 years agoAdd encoding size asserts 63/84663/1
Robert Varga [Thu, 19 Sep 2019 19:20:16 +0000 (21:20 +0200)]
Add encoding size asserts

There is a number of places where we check serialize/deserialize
operations through ByteArrayOutputStream. In order to check stability
(and evolution) of our serialization formats, it is useful to check
the sizes of the intermediate bytes.

JIRA: CONTROLLER-1919
Change-Id: I171894ba3791245a53fe39c2d3238d2341d8ffc4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 1a21b64021f37d862c503652368bb0d223a451d7)

4 years agoSeparate out AbstractNormalizedNodeDataInput 96/84596/1
Robert Varga [Tue, 17 Sep 2019 21:35:14 +0000 (23:35 +0200)]
Separate out AbstractNormalizedNodeDataInput

As we are going to introduce a streaming format for Magnesium, which
uses very different token set, it is convenient to have a common
base class which does not have conotations about what the tokens are.

We provide a baseline counterpart to AbstractNormalizedNodeDataOutput
and base AbstractLithiumDataInput on it. The asymmetry of
writeYangInstanceIdentifier() is fixed by moving it to
AbstractLithiumDataOutput.

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

4 years agoAdd @SupressFBWarnings around Await.result() 95/84595/1
Robert Varga [Sat, 14 Sep 2019 06:27:19 +0000 (08:27 +0200)]
Add @SupressFBWarnings around Await.result()

Await.result() is throwing Exceptions we need to catch, raising
the ire of SpotBugs. Suppress that.

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

4 years agoMake sure we know the version we encountered 94/84594/1
Robert Varga [Wed, 18 Sep 2019 00:11:23 +0000 (02:11 +0200)]
Make sure we know the version we encountered

Hitting this exception is not providing sufficent detail as to
what the proposed version is. Add that information.

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

4 years agoOptimize anyxml output 93/84593/1
Robert Varga [Thu, 12 Sep 2019 15:33:59 +0000 (17:33 +0200)]
Optimize anyxml output

We do not need to instantiate a new factory every time we perform
encoding, keep the factory as a shared constant.

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

4 years agoMove Lithium-specific logic from AbstractNormalizedNodeDataOutput 92/84592/1
Robert Varga [Wed, 11 Sep 2019 20:09:49 +0000 (22:09 +0200)]
Move Lithium-specific logic from AbstractNormalizedNodeDataOutput

The binding to TokenTypes and co. are really part of
AbstractLithiumDataOutput, as different serialization streams
versions can use completely different tokens and sizing.

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

4 years agoRemove ensureHeaderWritten() from writeNode() 91/84591/1
Robert Varga [Wed, 11 Sep 2019 20:05:19 +0000 (22:05 +0200)]
Remove ensureHeaderWritten() from writeNode()

This updates documentation of AbstractNormalizedNodeDataOutput
to make it clear that the NormalizedNodeStreamWriter aspect of
it is an implementation detail and that the stream has been
header-initialized by the time any of those methods are called.

The clarification renders calling ensureHeaderWritten() from
writeNode() superfluous, as at that point it is guaranteed to
be a no-op.

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

4 years agoReorganize AbstractNormalizedNodeDataOutput 90/84590/1
Robert Varga [Wed, 11 Sep 2019 15:44:47 +0000 (17:44 +0200)]
Reorganize AbstractNormalizedNodeDataOutput

This reorganizes AbstractNormalizedNodeDataOutput so that it
implements all NormalizedNodeDataOutput with final methods,
deferring implementation as need to abstract methods.

This way we have precisely one implementation of public methods,
making it easy to audit for correctness. Furthermore it eliminates
writeAugmentationIdentifier() override in NeonSR2 writer.

It also introduces writeQNameInternal(), which skips header checks,
as the call sites have already performed those checks.

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

4 years agoSplit out AbstractLithiumDataInput 89/84589/1
Robert Varga [Sun, 8 Sep 2019 18:26:18 +0000 (20:26 +0200)]
Split out AbstractLithiumDataInput

This splits out AbstractLithiumDataInput and disconnects Lithium
and NeonSR2 reader implementations. This allows Neon SR2 to be loaded
without Lithium, thus reducing the number of actual possible
implementations at runtime.

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

4 years agoCleanup PathArgumentTypes 88/84588/1
Robert Varga [Wed, 11 Sep 2019 13:09:13 +0000 (15:09 +0200)]
Cleanup PathArgumentTypes

Do not use long qualifiers for individual types, preferring
importing them. Also drop public modifiers, as this class is
package-private. Finally import static checkArgument().

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

4 years agoAbstractNormalizedNodeDataOutput fails to write out header 87/84587/1
Robert Varga [Wed, 11 Sep 2019 14:06:59 +0000 (16:06 +0200)]
AbstractNormalizedNodeDataOutput fails to write out header

In case AbstractNormalizedNodeDataOutput is used in a way, where
NormalizedNodeDataOutput.writePathArgument() is the first method
invoked, the stream header would not be output, leading to it
being unreadable.

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