controller.git
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)

4 years agoTighten AbstractLithiumDataOutput.writeString() 86/84586/1
Robert Varga [Sat, 7 Sep 2019 09:55:28 +0000 (11:55 +0200)]
Tighten AbstractLithiumDataOutput.writeString()

We can only ever pass nulls from Revision encoding, refactor to
make that clear (and enforced) in code. This more clearly defines
the context of TokenTypes.IS_NULL_VALUE and where it can be emitted.

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

4 years agoRemove NormalizedNodeOutputStreamWriter 85/84585/1
Robert Varga [Sat, 7 Sep 2019 09:22:39 +0000 (11:22 +0200)]
Remove NormalizedNodeOutputStreamWriter

This class is tied to NeonSR2 serialization format through subclassing,
where it really is a package-private detail. This leads to two concrete
classes being in existence for a particular format, which simply does
not make sense.

Eliminating this subclass allows us to make Neon SR2 final, thus arriving
and monomorphic or bimorphic invocation of all methods based on whether
we have seen Lithium (well, Oxygen) format at runtime.

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

4 years agoDisconnect {Lithium,NeonSR2} implementations 84/84584/1
Robert Varga [Sat, 7 Sep 2019 07:54:32 +0000 (09:54 +0200)]
Disconnect {Lithium,NeonSR2} implementations

We will need to define two new serialization formats: one
sharing object value serialization (for NeonSR3) and one
disconnected from it (for Magnesium).

In order to maintain scalability with so many formats, we want
to avoid JIT considering implementations which were not referenced
at runtime. This should make CHA and method dispatch more
efficient.

Since we are isolating things, we also pull ValueTypes lookups
and keep it in the same class for easier understanding.

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

4 years agoLower ValueTypes constant visibility 83/84583/1
Robert Varga [Sat, 7 Sep 2019 07:01:43 +0000 (09:01 +0200)]
Lower ValueTypes constant visibility

This is a package-private class, hence 'public' is superfluous.

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

4 years agoFix checkstyle/spotbugs violations 82/84582/1
Robert Varga [Tue, 3 Sep 2019 07:34:01 +0000 (09:34 +0200)]
Fix checkstyle/spotbugs violations

Enabling checkstyle/spotbugs by default finds these, fix them up.

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

4 years agoCleanup ValueTypes lookup 81/84581/1
Robert Varga [Wed, 28 Aug 2019 12:56:04 +0000 (14:56 +0200)]
Cleanup ValueTypes lookup

Change type of TYPES to ImmutableMap, so we are binding to a concrete
class when looking up. Also clean up initialization to follow fluent
builder pattern.

Finally inline requireNonNull() call into the invocation, so that its
return value is not wasted.

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

4 years agoDeduplicate MapNode key leaf values 80/84580/1
Robert Varga [Mon, 26 Aug 2019 20:44:30 +0000 (22:44 +0200)]
Deduplicate MapNode key leaf values

When we are encountering a leaf node inside a MapEntryNode, it can
be a leaf corresponding to a key -- in which case its value is
already present in NodeIdentifierWithPredicates and we do want to
de-duplicate those objects.

JIRA: CONTROLLER-1908
Change-Id: I2ed65c311f9921aa77c9f23bd1f7681d7f11355a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 76b19a3323d73115a126f17bd17d893c5ebdba83)

4 years agoMove common code to startNode() 79/84579/1
Robert Varga [Tue, 27 Aug 2019 09:34:34 +0000 (11:34 +0200)]
Move common code to startNode()

We are duplicating null checks in all entrypoints which lead to
startNode(). We can centralize these in startNode(), leading to
denser code and fixing Sonar warnings.

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

4 years agoReduce reliance on Guava Fuction/Supplier 78/84578/1
Robert Varga [Wed, 21 Aug 2019 08:55:57 +0000 (10:55 +0200)]
Reduce reliance on Guava Fuction/Supplier

We have JDK8+ equivalents, use those instead.

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

4 years agoFix modernization issues 77/84577/1
Robert Varga [Tue, 20 Aug 2019 19:06:59 +0000 (21:06 +0200)]
Fix modernization issues

This fixes issues pointed out by Modernizer, which mostly boil
down to using Objects.requireNonNull() and direct java.util
collections.

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

4 years agoClean up opendaylight-inventory model 52/84252/2
Robert Varga [Thu, 5 Sep 2019 06:52:10 +0000 (08:52 +0200)]
Clean up opendaylight-inventory model

This is just a formatting change, cleaning up descriptions and
comments.

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

4 years agoRevert "Bug 3871: Deprecate opendaylight-inventory model." 51/84251/2
Robert Varga [Thu, 5 Sep 2019 06:34:00 +0000 (08:34 +0200)]
Revert "Bug 3871: Deprecate opendaylight-inventory model."

This reverts commit 973bde38d5f02b4e65f20363ef03d17587433a21,
as the migration is not coming along and deprecated constructs
are causing massive number of warnings, hiding more important
ones.

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

4 years agoFixup chunk offset movement on resend 97/84497/2
Tomas Cere [Tue, 30 Jul 2019 09:48:06 +0000 (11:48 +0200)]
Fixup chunk offset movement on resend

Since we are moving the offset backwards on failures, it doesnt
matter whether we have seen a failure or success when incrementing
offset. We always need to move it to indicate a chunk is in flight,
otherwise canSendNextChunk() will allow us to send the same chunk
again and again even when it is already inflight.

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

4 years agoLost commit index when a snapshot is captured 91/84491/2
Tomas Cere [Tue, 6 Aug 2019 11:46:32 +0000 (13:46 +0200)]
Lost commit index when a snapshot is captured

When we have no journals and a snapshot is recovered and
immediately captured again, if there was no movement in the
datastore we loose the lastIndex and term from the previous snapshot.
We can safely reuse these from the previous snapshot when no
entry is present in the ReplicatedLog.

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

4 years agoDrop public modifier from NodeTypes 05/84005/2
Robert Varga [Mon, 26 Aug 2019 21:17:51 +0000 (23:17 +0200)]
Drop public modifier from NodeTypes

The class itself is not visible outside of the package, there is no
point to declare the constants as public.

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

4 years agoRename SodiumNormalizedNode* classes 07/84007/2
Robert Varga [Mon, 26 Aug 2019 22:08:05 +0000 (00:08 +0200)]
Rename SodiumNormalizedNode* classes

These are implementing Neon SR2 serialization format, hence they
should be named as such.

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

4 years agoBump versions by x.y.(z+1) 18/84518/1
jenkins-releng [Wed, 18 Sep 2019 09:13:25 +0000 (09:13 +0000)]
Bump versions by x.y.(z+1)

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

4 years agoMove DataNormalizationOperation methods 62/83862/2
Robert Varga [Tue, 20 Aug 2019 19:20:55 +0000 (21:20 +0200)]
Move DataNormalizationOperation methods

Some these are not use in the base class, move them closer to their
users.

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

4 years agoFinal bits of NodeIdentifier migration 71/83871/2
Robert Varga [Wed, 21 Aug 2019 10:33:36 +0000 (12:33 +0200)]
Final bits of NodeIdentifier migration

This picks up the last two callers of getKeyValues() and migrates
them to using asMap().

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

4 years agoAnother round of checkstyle fixes 72/83872/1
Robert Varga [Wed, 21 Aug 2019 09:40:15 +0000 (11:40 +0200)]
Another round of checkstyle fixes

This fixes failures reported by upgraded checkstyle, as well as
some non-enforced violations.

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

4 years agoMigrate away from Throwables.propagate() 48/83848/2
Robert Varga [Tue, 20 Aug 2019 22:31:55 +0000 (00:31 +0200)]
Migrate away from Throwables.propagate()

This method has been deprecated, move off of it.

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

4 years agoRefactor AbstractBrokerAwareActivator 42/83842/2
Robert Varga [Tue, 20 Aug 2019 20:19:57 +0000 (22:19 +0200)]
Refactor AbstractBrokerAwareActivator

This simplifies the implementation by encapsulating state.

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

4 years agoMove createProxy() 44/83844/2
Robert Varga [Tue, 20 Aug 2019 20:56:26 +0000 (22:56 +0200)]
Move createProxy()

This is a simple internal method, inline it.

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

4 years agoMigrate NodeIdentifierWithPredicates.getKeyValues() 43/83843/2
Robert Varga [Tue, 20 Aug 2019 19:17:57 +0000 (21:17 +0200)]
Migrate NodeIdentifierWithPredicates.getKeyValues()

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

4 years agoFixup checkstyle 41/83841/2
Robert Varga [Tue, 20 Aug 2019 19:04:19 +0000 (21:04 +0200)]
Fixup checkstyle

Updated checkstyle does not like some our docs, fix them up.

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

4 years agoPropagate action logical datastore type 88/83788/1
Robert Varga [Mon, 19 Aug 2019 12:01:27 +0000 (14:01 +0200)]
Propagate action logical datastore type

Unlike RFC7950 and related specifications, actions are generalized
in ODL to work on any datastore type, as otherwise internal cooperation
could not work on onything but operational datastore.

This patch correctly propagates the invocation datastore type, so that
invoking actions on top of config datastore becomes possible.

JIRA: CONTROLLER-1894
Change-Id: I20f340bee0321a446a07d701650d6dac57057ee6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 093728d9bc64609b5503ae9191a8cc1d0a937b79)

4 years agoChange in the version name 72/83772/3
Anushka Bhandari [Mon, 19 Aug 2019 19:38:11 +0000 (01:08 +0530)]
Change in the version name

This updates version to Sodium.

Change-Id: I579b891baeba329d3ded6816f59e1b2da18379e1
Signed-off-by: Anushka Bhandari <anushka16134@iiitd.ac.in>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove triemap-bom import 83/83783/1
Robert Varga [Tue, 20 Aug 2019 06:34:36 +0000 (08:34 +0200)]
Remove triemap-bom import

Triemap is provided by odlparent, remove the reference to it.

Change-Id: Ib37bc9957742a7e9f4e094248b6b8129a32ccd73
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump mdsal to 4.0.4 44/83644/1
Robert Varga [Thu, 15 Aug 2019 08:26:16 +0000 (10:26 +0200)]
Bump mdsal to 4.0.4

This brings in latest fixes.

Change-Id: I59f89ef4fe76ef16fcdc9b59f8d9b50aa0849847
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMake sure registrations are closed 80/83580/1
EmmettCox [Thu, 8 Aug 2019 11:01:42 +0000 (12:01 +0100)]
Make sure registrations are closed

This ensures registrations are closed as soon as they are not
needed.

JIRA: CONTROLLER-1906
Change-Id: I3a391f202963852f47486b78748c8e2d7e97162a
Signed-off-by: EmmettCox <emmett.cox@est.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUpdate .gitreview to stable/sodium 64/83564/1
jenkins-releng [Tue, 13 Aug 2019 02:47:26 +0000 (02:47 +0000)]
Update .gitreview to stable/sodium

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

4 years agoBump mdsal to 4.0.3 87/83087/9
Robert Varga [Thu, 18 Jul 2019 06:41:02 +0000 (08:41 +0200)]
Bump mdsal to 4.0.3

This bumps mdsal to 4.0.3, bringing in latest fixes and improvements.

Change-Id: Ie8e03aab1f31edf80bc9f1d7896c334c9d83be8d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump yangtools to 3.0.4 86/83086/7
Robert Varga [Thu, 18 Jul 2019 06:40:17 +0000 (08:40 +0200)]
Bump yangtools to 3.0.4

This picks up latest fixes and improvements.

Change-Id: I03201927d23762acf641c1ab0ff3419ba8b94969
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump odlparent to 5.0.1 85/83085/5
Robert Varga [Thu, 18 Jul 2019 06:39:32 +0000 (08:39 +0200)]
Bump odlparent to 5.0.1

This picks up the latest upgrades.

Change-Id: If6006a94197839a9718cd5eae16b0a025913af93
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd unit test for FrontedMetadata memory leaks 71/81971/30
Tomas Cere [Thu, 9 May 2019 09:12:34 +0000 (11:12 +0200)]
Add unit test for FrontedMetadata memory leaks

This memory leak occurs when write and read-only transactions
intertwine, leading to sparse range set.
We need to be able to request frontend metadata from shards,
so we can see whether it converges to a single range.

Also rework testing datastores, so we can inject custom testing
implementations allowing us to retrieve frontend metadata.

JIRA: CONTROLLER-1879
Change-Id: Ia8f350be7831b0c8f6846ee6fa41a665d1e191f4
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDo not log the whole DataTree at debug level 32/83232/2
Tomas Cere [Wed, 24 Jul 2019 10:40:29 +0000 (12:40 +0200)]
Do not log the whole DataTree at debug level

This needs to be at trace, as its polluting logs otherwise.

Change-Id: I6141a1793402e87ab49defe40007114b40d16335
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoForce AbstractRaftRPC to use Externalizable proxy pattern 65/83165/2
Robert Varga [Fri, 19 Jul 2019 07:15:15 +0000 (09:15 +0200)]
Force AbstractRaftRPC to use Externalizable proxy pattern

All implementations are already using the pattern, this change
makes that official and removes the no-arg constructor, which
is not used anyway.

Change-Id: Iaea4a2f39972537907cce19551d2ca6e4b33fad6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse merging transaction chains in dsbenchmark 58/83158/2
Robert Varga [Thu, 18 Jul 2019 17:21:29 +0000 (19:21 +0200)]
Use merging transaction chains in dsbenchmark

This functionality was broken, as the injection conversion done
for 4.0.0 did not take into account the fact we are dropping
type=pingpong.

Change-Id: I41244d6732216554e197ffe9b7ef6d5be41ab520
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMake RaftVersions a final class 64/83164/1
Robert Varga [Fri, 19 Jul 2019 07:22:53 +0000 (09:22 +0200)]
Make RaftVersions a final class

RaftVersions is a simple holder of constants, not an interfaces
which would be implemented. Change it to a utility class.

Change-Id: Ie7406cf579de2e4f17e03063f492eeb73d5ecb6c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRaise EOS unsuccessful request reporting to error 90/82990/3
Robert Varga [Wed, 10 Jul 2019 09:54:38 +0000 (11:54 +0200)]
Raise EOS unsuccessful request reporting to error

When we fail to send a message to the backend we are entering an
inconsistent state, where our users think the candidate is registered,
but the backend knows nothing about it -- which warrants an ERROR
level output.

Also place a FIXME on operations which should be retried.

JIRA: CONTROLLER-1904
Change-Id: I0799afe2e0786468cdef5f80c1064cb08d3c1af0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoEnforce RegisterListenerLocal arguments 89/82989/3
Robert Varga [Wed, 10 Jul 2019 09:59:42 +0000 (11:59 +0200)]
Enforce RegisterListenerLocal arguments

The fields need to be initialized to non-null, make sure the object
does that (instead of its users).

Change-Id: I545421167bd33e06ea7221a0fbcc136083bfc80d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoChange remaining SnapshotSelectionCriteria to prioritize timestamp 17/83017/2
Tomas Cere [Thu, 11 Jul 2019 10:19:47 +0000 (12:19 +0200)]
Change remaining SnapshotSelectionCriteria to prioritize timestamp

These are also needed and were missed in the original run-through.

Change-Id: Icede0673c580f793ffe81ccecf728c15dc6e83ca
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
4 years agoFurther Guava Optional cleanups 09/83009/6
Robert Varga [Wed, 10 Jul 2019 14:37:12 +0000 (16:37 +0200)]
Further Guava Optional cleanups

This migrates most of sal-akka-raft to use java.util.Optional.

Change-Id: Iaccc760101762dc9d4d647ded80de9a76f1f067b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMigrate most of CDS to use java.util.Optional 07/83007/6
Robert Varga [Wed, 10 Jul 2019 14:25:37 +0000 (16:25 +0200)]
Migrate most of CDS to use java.util.Optional

This picks up some stragglers, updating them to not use Guava's
Optional.

Change-Id: Id6e4c27e5bd55f19058e87f04473b859922bd441
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse OptionalLong to track enqueue time 06/83006/5
Robert Varga [Wed, 10 Jul 2019 14:07:59 +0000 (16:07 +0200)]
Use OptionalLong to track enqueue time

This prevents the need to box/unbox primitive longs and makes things
generally more convenient.

Change-Id: I6ca394526b09fdd469a9440c9313371e6185c135
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse OptionalLong in AbstractClientConnection 05/83005/5
Robert Varga [Wed, 10 Jul 2019 14:02:30 +0000 (16:02 +0200)]
Use OptionalLong in AbstractClientConnection

This removes the need for boxing longs.

Change-Id: I73a6c0be7f9a662f9e1df884f46adbc0fc121fb1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMigrate ShardDataTree to use OptionalLong 04/83004/5
Robert Varga [Wed, 10 Jul 2019 13:54:51 +0000 (15:54 +0200)]
Migrate ShardDataTree to use OptionalLong

This prevents boxing and is more modern than Guava's Optional<Long>.

Change-Id: Iaef3b7f18527f532ed2d775641cd855b14087fc1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMigrate InstallSnapshot/SnapshotTracker use of Optional 03/83003/5
Robert Varga [Wed, 10 Jul 2019 13:38:51 +0000 (15:38 +0200)]
Migrate InstallSnapshot/SnapshotTracker use of Optional

This patch migrates both classes to use Java 8 Optional and
OptionalInt.

Change-Id: Ib8e14f963b4e0db821fd8d3ab37f65b5bf5d5b54
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoConvert MessageTracker to use java.util.Optional 02/83002/3
Robert Varga [Wed, 10 Jul 2019 13:30:22 +0000 (15:30 +0200)]
Convert MessageTracker to use java.util.Optional

This migrates from Guava, using Java 8 equivalent.

Change-Id: I71d01dae05e4f426406989d240c12745149d6964
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMigrate ActorUtils to java.util.Optional 01/83001/3
Robert Varga [Wed, 10 Jul 2019 13:20:33 +0000 (15:20 +0200)]
Migrate ActorUtils to java.util.Optional

This migrates ActorUtils to Java 8 Optional, updating its users.

Change-Id: I0ec900d16bf44b2ab8ae48d8a72f2b63fa633312
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse OptionalInt in FlexibleThreadPoolWrapper 00/83000/1
Robert Varga [Wed, 10 Jul 2019 13:11:09 +0000 (15:11 +0200)]
Use OptionalInt in FlexibleThreadPoolWrapper

This gets rid of Guava Optional and fixes an unboxing warning
through use of Java 8.

Change-Id: I9c22bbedfcdd08f18c5ff14283dd8f130d6020c6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUpgrade jmh-core 62/82962/4
Robert Varga [Mon, 8 Jul 2019 13:53:29 +0000 (15:53 +0200)]
Upgrade jmh-core

This upgrade jmh-core to the latest release.

Change-Id: I6317ad6689fb5ac6d5156c9e6ddbfb1a6a051321
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMigrate to MD-SAL APIs 63/82963/3
Robert Varga [Mon, 8 Jul 2019 14:02:51 +0000 (16:02 +0200)]
Migrate to MD-SAL APIs

This removes controller dependencies.

Change-Id: Ic3fa0748d4e92f86899af2b8dcf73b7f1ae2560a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDo not depend on odl-mdsal-broker-local 59/82959/2
Robert Varga [Mon, 8 Jul 2019 13:38:03 +0000 (15:38 +0200)]
Do not depend on odl-mdsal-broker-local

odl-mdsal-trace depends on both odl-mdsal-broker (clustered) and
odl-mdsal-broker-local (non-clustered), which is not appropriate.
Remove the latter.

Change-Id: Ifdeb1c242004b6e365c133360c96af00c17c67c7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove odl-mdsal-all 58/82958/2
Robert Varga [Mon, 8 Jul 2019 13:35:29 +0000 (15:35 +0200)]
Remove odl-mdsal-all

This set of features was used for testing and does not really
contain 'all' features. Remove it in favor of explicitly listing
dependencies.

Change-Id: I4db4932594c17621ab2fb17f1436531ce3b7dbe5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoTeach sal-remoterpc-connector to route actions 83/82283/13
EmmettCox [Thu, 4 Jul 2019 16:31:38 +0000 (16:31 +0000)]
Teach sal-remoterpc-connector to route actions

sal-remoterpc-connector already handles routing of RPC registrations
and invocations across a cluster. Actions are very similar to RPCs,
hence it is natural to keep both in the same component.

This patch refactors common bits that go into tracking both, so that
we share common actors and concepts.

JIRA: CONTROLLER-1894
Change-Id: I0b9005bc3560b4dd5977a280d83eceebe132bec9
Signed-off-by: EmmettCox <emmett.cox@est.tech>
4 years agoAdd support for reusable streaming 17/82417/8
Robert Varga [Thu, 6 Jun 2019 10:26:37 +0000 (12:26 +0200)]
Add support for reusable streaming

With the actual implementations working on top of
NormalizedNodeStreamWriter, we gained the ability to flexibly
receive stream events.

This patch takes advantage of that flexibility by allowing
a ReusableImmutableNormalizedNodeStreamWriter to be the receiver
of the events -- thus allowing parts of the state involved in
building a NormalizedNode tree to be reused -- lowering GC
pressure.

A number of call sites, which can safely reuse such state are
converted to use the newly-introduced facility.

Change-Id: Iaf1b3ab2b2996e7004c036fc93a80a8ca8792314
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd streaming interface to NormalizedNodeDataInput 09/82009/24
Robert Varga [Mon, 13 May 2019 05:44:05 +0000 (07:44 +0200)]
Add streaming interface to NormalizedNodeDataInput

NormalizedNodeDataInput allows reading NormalizedNodes, which is
wired directly to immutable node builders, providing little
flexibility.

This inflexibility requires us to re-stream the data set through
NormalizedNodePruner, effectively doubling memory requirements
during recovery.

Extend NormalizedNodeDataInput to have a NormalizedNodeStreamWriter
to be plugged in, so that the byte stream becomes a source of
NormalizedNodeStreamWriter events, which can be routed through
a custom-built pipeline.

readNormalizedNode() becomes a simple default wrapper, which
pipes the stream into an ImmutableNormalizedNodeStreamWriter.

JIRA: CONTROLLER-1889
Change-Id: Ic732ba9105dd7e27d5612853b931aba66bdd83a5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix multiple snapshots present after journal removal 80/82380/8
Tomas Cere [Mon, 3 Jun 2019 13:02:08 +0000 (15:02 +0200)]
Fix multiple snapshots present after journal removal

After journal removal the sequence number starts counting from 0
once again. Therefore we can have multiple snapshots present and
snapshots with higher sequence number always take priority for loading
even when a newer snapshot is present.

Change this up in 2 ways:
1. disregard sequence number while deleting snapshots(delete all
snapshots with an older timestamp)
2. while loading snapshots prioritize timestamp rather than seqNr.

Also simplify LocalSnapshotStore.compare().

Change-Id: I205ea0ddf48d73b0a09297a1ce4e9fd514531993
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd transaction debugs 58/82858/2
Robert Varga [Mon, 1 Jul 2019 06:50:24 +0000 (08:50 +0200)]
Add transaction debugs

This adds a few debug messages allowing logs to be introspected
to see the timing of readying/applying transactions.

Change-Id: I1dde184023a034c6a0fa30e9a3898ab65db2decc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRename SODIUM versions to NEON_SR2 67/82867/2
Robert Varga [Fri, 28 Jun 2019 11:37:50 +0000 (13:37 +0200)]
Rename SODIUM versions to NEON_SR2

We are shipping these improvements in Neon SR2, which means we
should reserve this version not as Sodium.

Change-Id: If5caa0dd7510c6e1ffe3c483c74c456798ca6bb3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDeprecate all MD-SAL APIs 63/82863/1
Robert Varga [Mon, 1 Jul 2019 11:00:52 +0000 (13:00 +0200)]
Deprecate all MD-SAL APIs

These APIs have either been completely deprecated or have their
replacements in the mdsal project. Mark all of them as deprecated,
including their implementations.

JIRA: CONTROLLER-1902
Change-Id: I903afcef57c70c1013ab479cfcf31a42f475dc0f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMake private methods static 62/82862/1
Robert Varga [Mon, 1 Jul 2019 12:12:48 +0000 (14:12 +0200)]
Make private methods static

Eclipse is flagging a number of methods as potentially-static,
make sure we mark them as such.

Change-Id: I4254dd29716f4365d71f81c3f3a0e7a9590d9801
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove ShardManager.configListenerReg 61/82861/1
Robert Varga [Mon, 1 Jul 2019 12:06:28 +0000 (14:06 +0200)]
Remove ShardManager.configListenerReg

This field is not used anywhere, remove it.

Change-Id: Id66143aefea072ce6d529d39e86a961aa1d551ba
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMigrate use of AbstractDOMStoreTransaction 60/82860/1
Robert Varga [Mon, 1 Jul 2019 12:09:55 +0000 (14:09 +0200)]
Migrate use of AbstractDOMStoreTransaction

This utility class has been migrated to mdsal, use the instance
from there.

Change-Id: I9aad875f631903d4ce9dfb2779dfce6f8883a50c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoReset replyReceivedForOffset correctly 26/82726/1
Tomas Cere [Tue, 25 Jun 2019 12:16:50 +0000 (14:16 +0200)]
Reset replyReceivedForOffset correctly

replyReceivedForOffset needs to be set to the initial -1
otherwise we can have multiple sendSnapshotChunk()'s called
before receiving any replies. Which would fail due to the already
running stopwatch.

Change-Id: Ie708f0c2454a87f77cba97e4fed8a9ffc866b624
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
4 years agoFailed chunks should move offset backwards 25/82725/1
Tomas Cere [Tue, 25 Jun 2019 08:45:15 +0000 (10:45 +0200)]
Failed chunks should move offset backwards

If a chunk has failed it needs to move the offset backwards,
otherwise this would misalign the stream, or make it possible
to call sendNextChunk() right after resend which could be
seen as the chunkTimer attempted to be started while already running.

Change-Id: I6d44195ae9bcb23075ffea9c4f1d1ab1d0540c93
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
4 years agoFix IMDS test synchronization 53/82553/1
Robert Varga [Tue, 18 Jun 2019 15:39:37 +0000 (17:39 +0200)]
Fix IMDS test synchronization

Before we close the DTCL we must make sure we flush all changes,
otherwise we could end up losing changes simply because we are no
longer interested in them.

JIRA: MDSAL-429
Change-Id: I6df384c375ea1692a10c9f460d3dceb626468061
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoReset snapshot progress on IOExceptions 94/82394/6
Tomas Cere [Tue, 4 Jun 2019 09:17:10 +0000 (11:17 +0200)]
Reset snapshot progress on IOExceptions

Also log the whole LeaderInstallSnapshotState of failures.

Change-Id: I33b1c38f2277f08acbe77bcb0c16d2dfe41d8851
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
4 years agoSend commitIndex updates to followers as soon as possible 98/82498/1
Robert Varga [Tue, 11 Jun 2019 13:42:34 +0000 (15:42 +0200)]
Send commitIndex updates to followers as soon as possible

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

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

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

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

4 years agoSimplify recoveryTime computation 58/82458/3
Robert Varga [Fri, 7 Jun 2019 22:44:58 +0000 (00:44 +0200)]
Simplify recoveryTime computation

Stopwatch.stop() returns self, take advantage of that to shorted
the code to compute the formatting string. Also drop toString()
call, as it is implied by string concat.

Change-Id: I4fa645e42fc38b5f9f0775d986fd17aa693725b1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSwitch default output stream version 13/82313/27
Robert Varga [Wed, 29 May 2019 16:17:13 +0000 (18:17 +0200)]
Switch default output stream version

All versioned callers have been converted to use appropriate
stream versions, this patch bumps the default unversioned stream
to Sodium version.

Since we're changing the serialization format for ExecuteRpc,
make sure we fully embrace writer/reader, so that we get better
instantiation.

JIRA: CONTROLLER-1888
Change-Id: I17deeda1a49394600a5b0f93bd46d3b2c812123c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump persisted PayloadVersion 14/82314/25
Robert Varga [Wed, 29 May 2019 16:23:04 +0000 (18:23 +0200)]
Bump persisted PayloadVersion

Since the NormalizedNodeStream format has changed, shard persisted
state is affected.

This patch bumps PayloadVersion and applies that bump to snapshots
and CommitTransactionPayload.

On recovery, a snapshot's need to migrate is reflected in its state,
and it is examined just as MigratedSerializables are.
CommitTransactionPayload is not examined, as understanding its
stream version would require deserializing at least its header.

JIRA: CONTROLLER-1888
Change-Id: I678527be4487ee1729123ba8b9dcd2269e6cf262
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump datastore version 11/82311/21
Robert Varga [Wed, 29 May 2019 14:59:01 +0000 (16:59 +0200)]
Bump datastore version

This bumps the ask-based protocol datastore version, so that
SODIUM_VERSION is using Sodium NormalizedNode{Input,Output}.

JIRA: CONTROLLER-1888
Change-Id: Ib4ad1c27566179db958ad7776f81417ab99a78cf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd QNameModule coding 26/82426/5
Robert Varga [Thu, 6 Jun 2019 17:36:06 +0000 (19:36 +0200)]
Add QNameModule coding

Coding on QNames is effective when there are a lot of same QNames,
but there are cases where QNames themeselves are not reused --
for example YangInstanceIdentifiers and small read subtrees.

These typically end up using different QNames from a small set
of modules, hence coding modules actually helps them quite a bit.

This patch adds a namespace/revision cache, so that encoding such
QNames is also efficient.

JIRA: CONTROLLER-1898
Change-Id: I6cd0885ef605e4a1bf7b768ffe215e9eb3e2fbc5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd buffering to LocalSnapshotStore 39/82439/3
Tomas Cere [Tue, 4 Jun 2019 13:32:20 +0000 (15:32 +0200)]
Add buffering to LocalSnapshotStore

These improve snapshot save/load load times by around 15-20%
on my environment.

Change-Id: I67236f7e97f519993031d462c947588004857c33
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>