controller.git
17 months agoRelease controller v4.0.13
jenkins-releng [Fri, 28 Oct 2022 20:45:17 +0000 (20:45 +0000)]
Release controller

17 months agoBump scala to 2.13.10 36/102936/1
Robert Varga [Thu, 13 Oct 2022 13:42:31 +0000 (15:42 +0200)]
Bump scala to 2.13.10

https://github.com/scala/scala/releases/tag/v2.13.10

Change-Id: I2c18e38c5f72be43f4bfb71c67049552ad690784
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit f0c5113627c58b99f39c0d4acd0f65960106c97f)
(cherry picked from commit 782176889ef2a8c0ed18a1a5d2aa173ff3fc9724)

17 months agoBump Scala to 2.13.9 35/102935/1
Robert Varga [Thu, 22 Sep 2022 15:26:13 +0000 (17:26 +0200)]
Bump Scala to 2.13.9

https://github.com/scala/scala/releases/tag/v2.13.9

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

17 months agoBump Akka to 2.6.20 34/102934/1
Robert Varga [Wed, 7 Sep 2022 10:33:40 +0000 (12:33 +0200)]
Bump Akka to 2.6.20

https://akka.io/blog/news/2022/09/06/akka-2.6.20-released
https://github.com/real-logic/agrona/releases/tag/1.15.0
https://github.com/real-logic/agrona/releases/tag/1.15.1
https://github.com/real-logic/agrona/releases/tag/1.15.2
https://github.com/real-logic/aeron/releases/tag/1.38.0
https://github.com/real-logic/aeron/releases/tag/1.38.1

JIRA: CONTROLLER-2048
Change-Id: I4d3b2da9bd1a716403bfae5b957c73b05406ba15
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 2f5d6ed35dcae3c1ea40f89265410751c107e631)
(cherry picked from commit 16d97d4333ff5164adf3249a25c1991787512984)

17 months agoBump junit-4-13_2.13 33/102933/1
Robert Varga [Wed, 7 Sep 2022 16:13:02 +0000 (18:13 +0200)]
Bump junit-4-13_2.13

Adopt version 3.2.13.0.

Change-Id: I421dd2ae4be9a560eaeffe6f86d9828ed9c2e7eb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 59eb4d85a2259c15767e3cef47ea6127c0bb51cd)
(cherry picked from commit b0dac9508fde949a947173ea1e875a5c8f2335ae)

17 months agoBump reactive-streams to 1.0.4 32/102932/1
Robert Varga [Wed, 7 Sep 2022 16:13:35 +0000 (18:13 +0200)]
Bump reactive-streams to 1.0.4

https://github.com/reactive-streams/reactive-streams-jvm/blob/master/RELEASE-NOTES.md#version-104-released-on-2022-05-20

Change-Id: I6f9072f4b053f831a4855c2c5c97ad8509d9e8bb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 155fbbe1a4d830eb87a0cbaff132ca462040e2b3)
(cherry picked from commit a06f530374814e23d77c246cc3254838c6a6532b)

17 months agoBump upstreams 31/102931/1
Robert Varga [Fri, 28 Oct 2022 19:59:28 +0000 (21:59 +0200)]
Bump upstreams

Adopt:
- odlparent-9.0.16
- yangtools-7.0.18
- mdsal-8.0.16

Change-Id: Iae5d79c0035df31b383c99216813eb10847d5c06
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 months agoAdd a missing @Override annotation 61/101161/1
Robert Varga [Thu, 26 May 2022 17:12:25 +0000 (19:12 +0200)]
Add a missing @Override annotation

writeReplace() is specified by payload, make sure we mark it as such.

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

23 months agoMake Payload Serializable 69/101269/3
Robert Varga [Fri, 13 May 2022 12:52:16 +0000 (14:52 +0200)]
Make Payload Serializable

All payloads are serialized via Java serialization, which is not great,
but needs to be expressed in the API contract. Also codify that each
payload needs to have a serializable proxy.

JIRA: CONTROLLER-2037
Change-Id: I99f146413e42af68bb33b942c2222c091a87cf3f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 04a652e0245df42e15ac4d9cff63c55a42eed2ca)

23 months agoMove {Identifiable,Persistent,}Payload 68/101268/2
Robert Varga [Fri, 13 May 2022 12:23:27 +0000 (14:23 +0200)]
Move {Identifiable,Persistent,}Payload

Payloads are really part of raft message specification, not some vague
sal-clustering-commons detail. They have a strong relationship with
AppendEntries and therefore really need to be co-located.

As a first step in dealing with AppendEntries sizing, move Payloads so
we can properly evolve them.

JIRA: CONTROLLER-2037
Change-Id: I069f311b1c1b211b8429a721e6b239e5e08ed813
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 534bf6f83465cc8a575b097c1e28fbb1f34d110a)

23 months agoBump versions to 4.0.13-SNAPSHOT 32/101232/2
Robert Varga [Thu, 19 May 2022 06:14:57 +0000 (08:14 +0200)]
Bump versions to 4.0.13-SNAPSHOT

This starts the next development iteration.

Change-Id: Ib2fee47e273bfa1e0e48f6de65cd12d4653c0ce4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoBump upstreams 31/101231/2
Robert Varga [Thu, 19 May 2022 06:10:45 +0000 (08:10 +0200)]
Bump upstreams

Adopt:
- odlparent-9.0.15
- yangtools-7.0.17
- mdsal-8.0.15

Change-Id: I617fd4c64b778d4f861bcfa25486fa78014dac14
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoSimplify cutover expression 56/101156/1
Robert Varga [Wed, 18 May 2022 09:39:24 +0000 (11:39 +0200)]
Simplify cutover expression

Rather than having a !(A&&B), use (!A || !B).

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

23 months agoBump versions to 4.0.12-SNAPSHOT 34/101134/2
Robert Varga [Sun, 15 May 2022 20:28:55 +0000 (22:28 +0200)]
Bump versions to 4.0.12-SNAPSHOT

This starts the next development iteration.

Change-Id: I24bb75fefa87dbe50bcc356c241e959ce9cf93e1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoBump upstreams 31/101131/1
Robert Varga [Sat, 14 May 2022 14:24:54 +0000 (16:24 +0200)]
Bump upstreams

Adopt:
- odlparent-9.0.14
- yangtools-7.0.16
- mdsal-8.0.14

Change-Id: I52dcc2c85ebd3bfda10e803cae6f166fd5e23a25
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
23 months agoDo not depend directly on mdsal-binding-dom-codec 02/100602/1
Robert Varga [Thu, 28 Apr 2022 17:34:35 +0000 (19:34 +0200)]
Do not depend directly on mdsal-binding-dom-codec

Depend on the API package, not the entire codec.

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

2 years agoHandle the case when newModification() fails 82/100782/2
Robert Varga [Tue, 19 Apr 2022 20:53:18 +0000 (22:53 +0200)]
Handle the case when newModification() fails

When we are chaining DataTreeModification on top of each other, it is
possible that we have an invalid modification, which fails to apply. In
that case there is nothing we can do, as we cannot establish a baseline.

Handle this case by allocating a specialized modification
implementation, which allows close to no interactions.

JIRA: CONTROLLER-2039
Change-Id: I9b55da7ccc89c9aeae641a049397d2120e292a9c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 7441c30c82b4007a09942839baca5c84de9e50b3)

2 years agoFail read requests after we have observed a modification failure 80/100780/1
Robert Varga [Sun, 24 Apr 2022 08:16:42 +0000 (10:16 +0200)]
Fail read requests after we have observed a modification failure

A local RW transaction can intercept a modification. If this happens, we
postpone the failure until commit time, but we must not allow further
reads to be satisfied, as they may end up returning incorrect data.

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

2 years agoCleanup Local*ProxyTransactionTest 79/100779/1
Robert Varga [Sun, 24 Apr 2022 16:26:06 +0000 (18:26 +0200)]
Cleanup Local*ProxyTransactionTest

Do not use expected exceptions and use static imports for asserts.

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

2 years agoImprove IdentifiablePayload.toString() implementations 78/100778/1
Robert Varga [Sun, 24 Apr 2022 16:01:13 +0000 (18:01 +0200)]
Improve IdentifiablePayload.toString() implementations

We can expose at least the size (and most of the time identity) of the
payload. Let's do that to ease debugging.

JIRA: CONTROLLER-2043
Change-Id: Ia0f1e17ca46de8a9d117d5f8bdb85b246e32be01
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 6016f3caa10acd06e9ebd2f813851ef1c9539176)

2 years agoAdd more tracing to DataJournalV0 77/100777/1
Robert Varga [Sun, 24 Apr 2022 14:58:40 +0000 (16:58 +0200)]
Add more tracing to DataJournalV0

We seem to have a problem with completing a specific write, add a few
more traces to try to pin the problem down.

JIRA: CONTROLLER-2043
Change-Id: I9efb37fd40e48ff81c988da7edcb0ae0010f7baf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 49a3316dd6237acc1c885529715ea24ecc80e52b)

2 years agoCompare messages in the log 99/100599/2
Robert Varga [Sun, 24 Apr 2022 13:54:04 +0000 (15:54 +0200)]
Compare messages in the log

Make sure we have the distinction between reordered messages and
messages getting missed.

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

2 years agoBump atomix to 3.1.12 98/100598/1
Robert Varga [Sun, 24 Apr 2022 12:45:36 +0000 (14:45 +0200)]
Bump atomix to 3.1.12

I could not find any release notes, so all we have is
https://github.com/atomix/atomix/compare/atomix-3.1.5...atomix-3.1.12

Of that only
https://github.com/atomix/atomix/commit/4a65503db2c810df7aa9f9b1dc0aec4debe21380
seems relevant.

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

2 years agoRoute {Journal,Snapshot}Protocol messages to DataPersistenceProvider 97/100597/1
Robert Varga [Sun, 24 Apr 2022 11:17:15 +0000 (13:17 +0200)]
Route {Journal,Snapshot}Protocol messages to DataPersistenceProvider

The way we wire our messages ends up being not exactly nice, as the
baseline RaftActor is not cognizant of all persistence operations. This
means it cannot correctly ignore responses to deletion of journal and
snapshot entries -- and hence we get dead letters logged.

Route JournalProtocol and SnapshotProtocol messages to
DataPersistenceProvider, which can then handle them and correctly
tell us whether to log them or not.

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

2 years agoImprove AbstractClientConnection nullness guarantees 71/100771/2
Robert Varga [Sun, 24 Apr 2022 08:45:15 +0000 (10:45 +0200)]
Improve AbstractClientConnection nullness guarantees

We have a few missing @NonNull annotations, make sure to add them.
Also remove a superfluous requireNonNull() in copy constructor.

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

2 years agoDo not use NPE for consistency checks 70/100770/2
Robert Varga [Sun, 24 Apr 2022 08:37:29 +0000 (10:37 +0200)]
Do not use NPE for consistency checks

We are using Preconditions.checkNotNull() when guarding against illegal
state. Improve this by using verifyNotNull(), which results in
VerifyException, making the intent clearer.

Also migrate a verify(foo != null) to a proper verifyNotNull(), using
the resoluting value.

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

2 years agoClean up unhandled request exceptions 96/100596/1
Robert Varga [Sun, 24 Apr 2022 08:23:22 +0000 (10:23 +0200)]
Clean up unhandled request exceptions

We have a few places which throw the same exception, make sure we
share the formatting and expose the proper control flow to Java.

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

2 years agoImprove LocalProxyTransaction.doExists() 60/100660/1
Robert Varga [Tue, 19 Apr 2022 20:50:22 +0000 (22:50 +0200)]
Improve LocalProxyTransaction.doExists()

We can use immediateBooleanFluentFuture() and skip allocating two
objects.

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

2 years agoRemove FindBugs workaround 59/100659/1
Robert Varga [Tue, 19 Apr 2022 20:15:10 +0000 (22:15 +0200)]
Remove FindBugs workaround

SpotBugs no longer throws a fit on callback's nullness, remove the
workaround. Also do not execute read/exists if there is no callback
-- although there always should be.

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

2 years agoExpose CursorAwareDataTreeSnapshot from local RW proxy 58/100658/1
Robert Varga [Tue, 19 Apr 2022 19:00:44 +0000 (21:00 +0200)]
Expose CursorAwareDataTreeSnapshot from local RW proxy

We can improve type safety a bit by exposing the fact the backing
snapshot supports cursors.

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

2 years agoImplement scatter/gather on module shards 80/100480/3
Robert Varga [Thu, 7 Apr 2022 15:45:48 +0000 (17:45 +0200)]
Implement scatter/gather on module shards

ClientBackedDatastore does perform module shard root scatter/gather,
hence reads of root end up talking to only the default shard.

Refactor the scatter/gather logic from DistributedDatastore into a
common component and use it for both modes of operation.

JIRA: CONTROLLER-2038
Change-Id: Ib04efab46e36e512eb89606d026fd2082de1b693
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 438d5278050961f0773707e6508b1b736eac1c0f)

2 years agoNormalizedNodeAggregator should also report empty 53/100453/1
Robert Varga [Thu, 7 Apr 2022 20:23:33 +0000 (22:23 +0200)]
NormalizedNodeAggregator should also report empty

DataTree root is always present as of now, which means that even if we
pretend there is no result, the result of aggregation is non-empty.

Fix NormalizedNodeAggregator to check whether there was any operation
applied before running actual transaction.

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

2 years agoUse ImmutableBiMap builder fluently 52/100452/1
Robert Varga [Thu, 7 Apr 2022 15:16:07 +0000 (17:16 +0200)]
Use ImmutableBiMap builder fluently

We can simply allocate the builder without intermediate local, saving
us an import. Also split the locked update part into a separate method
to aid inlining.

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

2 years agoAdd supervisor to EOS singleton actor 47/100347/1
Shibu Vijayakumar [Fri, 1 Apr 2022 18:14:34 +0000 (18:14 +0000)]
Add supervisor to EOS singleton actor

The actor may fail, for example due to AskTimeoutException. This still
needs to be investigated, but mitigate the failure by adding an
OwnerSupervisor to restart it on failure.

JIRA: CONTROLLER-2035
Change-Id: I2dafaa35804357415d9aaa5400372cfd8e54b85b
Signed-off-by: Shibu Vijayakumar <shibu.vijayakumar@infosys.com>
(cherry picked from commit 7d48c55ad33bcb69e9e373b3e169b530771e60ab)

2 years agoBump akka to 2.6.19 36/100036/1
Robert Varga [Thu, 24 Mar 2022 20:23:11 +0000 (21:23 +0100)]
Bump akka to 2.6.19

https://akka.io/blog/news/2022/03/21/akka-2.6.19-released

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

2 years agoBump mdsal to 8.0.13 99/100099/1
Robert Varga [Sun, 13 Mar 2022 11:14:10 +0000 (12:14 +0100)]
Bump mdsal to 8.0.13

Pick up a few bugfixes from upstream.

Change-Id: I7213a473dba7c0d91aa61ffb389e166aba01440f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoIntroduce remaining cli commands for clustering-test-app 32/100032/1
Dominik Vrbovsky [Wed, 16 Feb 2022 07:32:28 +0000 (08:32 +0100)]
Introduce remaining cli commands for clustering-test-app

There are some RPCs that were not reworked to Karaf CLI commands
during first round of introducing these commands, so we need to
introduce them as well and have complete set of commands.

JIRA: CONTROLLER-1995
Change-Id: Ifbb67e26fb4ede4a589dd07999b52e3639e5c794
Signed-off-by: Dominik Vrbovsky <dominik.vrbovsky@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 53460d7e6a49d1d1e37506d0e9133df7852af834)

2 years agoUse CommitInfo in AsyncNotifyingSettableFuture 30/100030/1
Robert Varga [Wed, 9 Mar 2022 18:04:16 +0000 (19:04 +0100)]
Use CommitInfo in AsyncNotifyingSettableFuture

We are performing a future transformation which boils down to converting
a null (Void) into an CommitInfo.empty().

Rather than doing that, let's make sure AsyncNotifyingSettableFuture
results directly in CommitInfo, removing the need for transformation,
saving us an object allocation and a few CPU cycles.

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

2 years agoBump mdsal to 8.0.12 97/99797/1
Robert Varga [Fri, 18 Feb 2022 10:50:45 +0000 (11:50 +0100)]
Bump mdsal to 8.0.12

Pick up the single fix from upstream.

Change-Id: I27e3c14ae8dc86110932466519ba4b824ded9c21
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 4.0.11-SNAPSHOT 35/99735/1
Robert Varga [Mon, 14 Feb 2022 15:26:41 +0000 (16:26 +0100)]
Bump versions to 4.0.11-SNAPSHOT

This starts the next development iteration.

Change-Id: I5e82321e2ff8dd7552d364270f9aa1834f19958c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix yangtools mis-alignment 32/99732/1
Robert Varga [Mon, 14 Feb 2022 14:55:02 +0000 (15:55 +0100)]
Fix yangtools mis-alignment

We have a mis-aligned yangtools versions, fix that up.

Change-Id: I5153b518d2146eef8e3d7cb239a05686515755cc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 4.0.10-SNAPSHOT 10/99710/1
Robert Varga [Mon, 14 Feb 2022 08:27:09 +0000 (09:27 +0100)]
Bump versions to 4.0.10-SNAPSHOT

This starts the next development iteration.

Change-Id: I668b50e9453e446fbae93795ae39ef3c76f36aa4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump upstream versions 08/99708/1
Robert Varga [Mon, 14 Feb 2022 07:26:31 +0000 (08:26 +0100)]
Bump upstream versions

Adopt:
- odlparent-9.0.13
- yangtools-7.0.13
- mdsal-8.0.11

Change-Id: I4987c100930e883b51f8b519d2a1f9696196a032
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump versions to 4.0.9-SNAPSHOT 82/99382/2
Robert Varga [Wed, 19 Jan 2022 12:27:47 +0000 (13:27 +0100)]
Bump versions to 4.0.9-SNAPSHOT

This starts the next development iteration.

Change-Id: Ifd044e7a9d6ee1c5268d053702b8c511e6901575
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix clearing of candidates from previous iterations 01/99401/1
Tomas Cere [Tue, 21 Dec 2021 16:16:40 +0000 (17:16 +0100)]
Fix clearing of candidates from previous iterations

During initialization the CandidateRegistry wasnt clearing
candidates from the previous instance in a reliable way.
Event with ReadMajority if the cluster members havent been updated
yet, it acted as if there were no candidates present so it did
not clear them.

Introduce a mechansim that goes through the akka singleton that
picks owners, so it only executes the clearing of candidates once
the cluster is in a healthy state.

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

2 years agoBump upstream versions 81/99381/1
Robert Varga [Wed, 19 Jan 2022 12:27:01 +0000 (13:27 +0100)]
Bump upstream versions

Adopt:
- odlparent-9.0.12
- yangtools-7.0.12
- mdsal-8.0.10

Change-Id: Ia0b658d8c92e5ae41e50e13f01c848fb4ffb6b81
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRestart downed nodes. 23/99323/1
Tomas Cere [Wed, 8 Dec 2021 11:40:40 +0000 (12:40 +0100)]
Restart downed nodes.

Nodes can be downed by sbr(for example when Isolated, sbr makes the
decision to down the minority), so we need to make sure they can
come up automatically unless we have another mechanism in place
for bringing up downed nodes.

JIRA: CONTROLLER-2025
Change-Id: I23d3ca2cee471c51d0eadc6c426461aa6eef193d
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
(cherry picked from commit 46fedf6c2d91ea96c453c059c3b2b7a6c16c370f)

2 years agoEnable Split-Brain Resolver 22/99322/1
Tomas Cere [Mon, 22 Nov 2021 10:32:48 +0000 (11:32 +0100)]
Enable Split-Brain Resolver

In order to make EOS service work, we need to have a provider handling
dead nodes. Enable SBR to fill that role, so that we properly recover
from nodes going away.

JIRA: CONTROLLER-2025
Change-Id: Idf817455bfe2a90d6e02011eee4ed407e1254fd2
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 58e85a6f7c26366affdc65477b817826bedfe6a7)

2 years agoBump akka to 2.6.18 24/99124/7
Robert Varga [Mon, 20 Dec 2021 11:52:55 +0000 (12:52 +0100)]
Bump akka to 2.6.18

https://akka.io/blog/news/2021/12/20/akka-2.6.18-released

JIRA: CONTROLLER-2027
Change-Id: I7ec7581f48610d8d8479e971186a16d6b870ed9c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump scala-java8-compat_2.13 to 1.0.2 86/99286/2
Robert Varga [Thu, 13 Jan 2022 10:23:18 +0000 (11:23 +0100)]
Bump scala-java8-compat_2.13 to 1.0.2

Akka 2.6.16+ is using version 1.0.0, and they are binary compatible,
let's make sure we align to a newer version as well.

https://github.com/scala/scala-java8-compat/releases/tag/v1.0.0
https://github.com/scala/scala-java8-compat/releases/tag/v1.0.1
https://github.com/scala/scala-java8-compat/releases/tag/v1.0.2

Change-Id: I6c5f21c296dae9ca7236487e460755f0ef3e7622
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump scala to 2.13.8 83/99283/2
Robert Varga [Thu, 13 Jan 2022 09:29:04 +0000 (10:29 +0100)]
Bump scala to 2.13.8

https://github.com/scala/scala/releases/tag/v2.13.7
https://github.com/scala/scala/releases/tag/v2.13.8

Change-Id: Ifc5ac268e531b10a9920c7a16bfbdbb3de12d611
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRework karaf CLI commands to print results on console 35/98635/2
Dominik Vrbovsky [Mon, 22 Nov 2021 10:56:26 +0000 (11:56 +0100)]
Rework karaf CLI commands to print results on console

Some of these karaf CLI commands may produce return values and some CSIT components need to
read them from console.

Change-Id: Iae54c9481515c1e8fc42e9b1cf7b1530d523a142
Signed-off-by: Dominik Vrbovsky <dominik.vrbovsky@pantheon.tech>
2 years agoBump upstream versions 51/99251/1
Robert Varga [Mon, 10 Jan 2022 13:10:56 +0000 (14:10 +0100)]
Bump upstream versions

Adopt:
- odlparent-9.0.10
- yangtools-7.0.11
- mdsal-8.0.9

Change-Id: I24be0e4be695c02720f139b25e0be9f7854410e7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoBump upstream versions 64/99164/1
Robert Varga [Sat, 25 Dec 2021 13:28:03 +0000 (14:28 +0100)]
Bump upstream versions

Adopt:
- odlparent-9.0.9
- yangtools-7.0.10
- mdsal-8.0.8

Change-Id: Ifbfb9c8b335bbf49df4a2965c5a4744ce558089b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup asserts a bit 27/99127/1
Robert Varga [Tue, 21 Dec 2021 08:38:43 +0000 (09:38 +0100)]
Cleanup asserts a bit

Rather than using String operations, use assertThat() and matchers.

Change-Id: I0e76854950965fbfef739c38b061ccda1a9f1e37
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoakka.actor.provider set to 'cluster' 33/98733/5
Dominik Vrbovsky [Mon, 6 Dec 2021 17:05:03 +0000 (18:05 +0100)]
akka.actor.provider set to 'cluster'

A number of sal-akka-raft test logs are polluted by ConfigurationException.
ActorSystem needs to have 'akka.actor.provider' set to 'cluster' in the
configuration.

JIRA: CONTROLLER-2023
Change-Id: If6e873864ffe0ea8261c80c233b6d40459d05164
Signed-off-by: Dominik Vrbovsky <dominik.vrbovsky@pantheon.tech>
2 years agoBump versions to 4.0.8-SNAPSHOT 95/98495/1
Robert Varga [Sun, 14 Nov 2021 09:12:49 +0000 (10:12 +0100)]
Bump versions to 4.0.8-SNAPSHOT

This starts the next development iteration.

Change-Id: I96de621e9636e25b8855e38c0d0cfc9c19fc063e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd an actor for entity rpc execution. 66/98466/2
Tomas Cere [Fri, 12 Nov 2021 17:17:00 +0000 (18:17 +0100)]
Add an actor for entity rpc execution.

Instead of entity-owners rpcs being handled by owner supervisor
directly add an actor that handles the execution, preventing failures
that happen after the akka singleton has moved to a different node.

This new actor first attempts to retrieve current data from the supervisor
and if that fails, falls back to using distributed-data.

JIRA: CONTROLLER-2010
Change-Id: Idf71d66d380402c10e276c726edef2f5034f7363
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup test format 93/98493/1
Robert Varga [Sun, 14 Nov 2021 06:26:53 +0000 (07:26 +0100)]
Cleanup test format

We have wrong spaces, fix them up.

Change-Id: I166314fe85d350292fa25f36cfdbb7cd5424be76
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoUse DateTimeFormatter in ShardStats 92/98492/1
Robert Varga [Sun, 14 Nov 2021 05:36:34 +0000 (06:36 +0100)]
Use DateTimeFormatter in ShardStats

This conversion allows us to drop a global lock. Also clean up the
associated test.

Change-Id: Ie91e99dd0d1ba4726b802c1c8953cfe1226714e1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoHandle ModifyTransactionRequest in forward path 89/98489/4
Robert Varga [Sat, 13 Nov 2021 18:38:08 +0000 (19:38 +0100)]
Handle ModifyTransactionRequest in forward path

When we have remote -> local handoff, we will use a
ModifyTransactionRequest, which we need to apply before moving on.

JIRA: CONTROLLER-2022
Change-Id: I04bdfda162d474966b153223c7480fd5b3af8099
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoModernize TransactionRateLimitingCallbackTest 85/98485/3
Robert Varga [Sat, 13 Nov 2021 18:05:06 +0000 (19:05 +0100)]
Modernize TransactionRateLimitingCallbackTest

Use assertThrows() and mockito runner.

Change-Id: I8cda7b267ebc923304e5b1b60c42d78a70d17d19
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoModernize ThreePhaseCommitCohortProxyTest 84/98484/3
Robert Varga [Sat, 13 Nov 2021 17:58:19 +0000 (18:58 +0100)]
Modernize ThreePhaseCommitCohortProxyTest

Use List.of(), assertEquals() and mockito runner.

Change-Id: Ide20b467ddc7128680f3f29668f4e978a978696e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup AbstractDOMBrokerWriteTransactionTest 83/98483/3
Robert Varga [Sat, 13 Nov 2021 17:39:45 +0000 (18:39 +0100)]
Cleanup  AbstractDOMBrokerWriteTransactionTest

Use mockito runner instead of initMocks().

Change-Id: I205513eb6600deb9380db9b0380e2f70ac556f89
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoClean up ClientBackedReadTransactionTest 82/98482/3
Robert Varga [Sat, 13 Nov 2021 17:36:24 +0000 (18:36 +0100)]
Clean up ClientBackedReadTransactionTest

Use mockito junit runner instead of initMocks().

Change-Id: I4d51748007191df9d490bf5b25cf03acdad8cc75
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup TransactionRateLimiterTest 81/98481/3
Robert Varga [Sat, 13 Nov 2021 17:31:11 +0000 (18:31 +0100)]
Cleanup TransactionRateLimiterTest

Use guava stopwatch and mockito runner.

Change-Id: I87fd7f6b32379307875a2d3f353e6ad2d5bc2d38
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMigrate AbstractClientHandleTest 80/98480/2
Robert Varga [Sat, 13 Nov 2021 17:16:20 +0000 (18:16 +0100)]
Migrate AbstractClientHandleTest

Mockito.initMocks() is deprecated, migrate to using mockito runner.

Change-Id: I6fbf7dd3502ed054701a1f6f41cd26e537b163e7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFold AbstractShardManagerTest 79/98479/3
Robert Varga [Sat, 13 Nov 2021 17:09:40 +0000 (18:09 +0100)]
Fold AbstractShardManagerTest

We have only a single subclass, ShardManagerTest, hence we can reduce
complexity by merging the two classes together. Also use
MockitoJUnitRunner to initialize mocks.

Change-Id: Idadafff3a3c96b38a5695ba903998382dc4054eb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMigrate AbstractProxyTransactionTest to MockitoJUnitRunner 75/98475/2
Robert Varga [Sat, 13 Nov 2021 16:14:32 +0000 (17:14 +0100)]
Migrate AbstractProxyTransactionTest to MockitoJUnitRunner

Do not use Mockito.openMocks(), but rather a proper runner.

Change-Id: I26d9d15cd10f8717c7bc36ccb91591a70305bda2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoEnable testTransactionWithIsolatedLeader() for tell-based protocol 74/98474/1
Robert Varga [Sat, 13 Nov 2021 14:47:43 +0000 (15:47 +0100)]
Enable testTransactionWithIsolatedLeader() for tell-based protocol

Behaviour differs between ask-based (which fails) and tell-based (which
continues retrying). Modify the test suite to account for this
difference.

JIRA: CONTROLLER-2018
Change-Id: I208fd8aa8088558dbe2160168ee35182e02c97fa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup IntegrationTestKit 73/98473/1
Robert Varga [Sat, 13 Nov 2021 14:27:44 +0000 (15:27 +0100)]
Cleanup IntegrationTestKit

Use equality on optionals, assertThrows(), and static imports of test
DSL.

Change-Id: I1e66e5b1a3e10dd2d866f355de0d24da604d2c3a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix error message concatenation 72/98472/1
Robert Varga [Sat, 13 Nov 2021 12:08:56 +0000 (13:08 +0100)]
Fix error message concatenation

We are missing a space here, fix that up.

Change-Id: I2eba64ddcb7db14a56eb65a84d25851e4869ba5a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoClean up modification tests 71/98471/1
Robert Varga [Sat, 13 Nov 2021 11:52:29 +0000 (12:52 +0100)]
Clean up modification tests

Make sure we close the read transaction and improve assertions with
Optional.

Change-Id: Ia465f64c5845e3d5e215759cc32048e06478104b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoEnable testLeadershipTransferOnShutdown() 97/98397/7
Robert Varga [Thu, 11 Nov 2021 01:01:42 +0000 (02:01 +0100)]
Enable testLeadershipTransferOnShutdown()

We are looking at cohort caches here -- and those are not used by
ClientBackedDatastore.

Change-Id: I3abfa3299d8222df6edfa98cc4a3d108a05454e4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoTrack skipped transactions 49/85749/63
Robert Varga [Tue, 12 Nov 2019 22:50:34 +0000 (23:50 +0100)]
Track skipped transactions

We are allocating transaction identifiers which are shared across
shards. As a transaction can touch only some shards, non-participating
shards will never see the transaction ID, leading to holes in their
UnsignedLongSets -- and those holes gradually eat up more and more
memory.

Track when we have such a hole and lazily forward a new request, which
purges one or more such identifiers -- plugging the memory leak.

The crux of the machinery is exchanging state between ProxyHistory
and FrontendHistoryMetadataBuilder.

JIRA: CONTROLLER-1991
Change-Id: I3817fa2841e5f9c405bb20ff1a104537ad459ce3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoHandle SnapshotComplete message 02/98402/4
Robert Varga [Thu, 11 Nov 2021 07:38:58 +0000 (08:38 +0100)]
Handle SnapshotComplete message

This is an internally-generated message, make sure we handle it in
support to indicate when we have finished completely propagating
state.

JIRA: CONTROLLER-2019
Change-Id: I4f5c5231070140d54531c2e5379dffcaf1c5c4ee
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDisable state tracking on ReadyLocalTransaction 03/98403/1
Robert Varga [Thu, 11 Nov 2021 08:22:08 +0000 (09:22 +0100)]
Disable state tracking on ReadyLocalTransaction

We are failing to recognize ReadyLocalTransaction as an ask-based
message, leading to us populating state.

JIRA: CONTROLLER-2021
Change-Id: I48b3c57e11430a5ca15e0559f2a8e13627f4bab1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoDrop a test re-enable FIXME 01/98401/2
Robert Varga [Thu, 11 Nov 2021 07:10:31 +0000 (08:10 +0100)]
Drop a test re-enable FIXME

Add an explicit JIRA tag to the FIXME.

Change-Id: If567cf66476a16ce3193d1a64e18538d7bdcab53
JIRA: CONTROLLER-2020
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd update FIXME to enable test 00/98400/3
Robert Varga [Thu, 11 Nov 2021 06:16:35 +0000 (07:16 +0100)]
Add update FIXME to enable test

Add an explicit reference to the issue tracking enablement of this
test.

JIRA: CONTROLLER-2018
Change-Id: I62fb6377e138cfb00deb0a3fd9093ec13f76dc46
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMove assumption 96/98396/4
Robert Varga [Thu, 11 Nov 2021 01:00:13 +0000 (02:00 +0100)]
Move assumption

Let's assume things only just before we are hitting and error and tag
the FIXME with an issue.

JIRA: CONTROLLER-2017
Change-Id: I114ff0f3ef2e72fdc1be5e8eb61adac8ed00ff42
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd a FIXME for enabling a test 95/98395/4
Robert Varga [Thu, 11 Nov 2021 00:47:15 +0000 (01:47 +0100)]
Add a FIXME for enabling a test

Record the problem observed and assign an issue to track it.

JIRA: CONTROLLER-2016
Change-Id: Idbf52a2598a93f55797954223de98cd974abac3a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRename UnsignedLongSet.size() 94/98394/1
Robert Varga [Wed, 10 Nov 2021 21:05:44 +0000 (22:05 +0100)]
Rename UnsignedLongSet.size()

Since we have 'Set' in our name, size() invokes Set.size(), which is
not we provide w.r.t. the number of distinct elements that are contained
in the set.

We are communicating how many ranges are stored, hence the method's name
is 'rangeSize()'.

Change-Id: Iaf9999db86fe03a8e753107638fc2e189b680677
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoMake UnsignedLongSet.Entry immutable 93/98393/1
Robert Varga [Wed, 10 Nov 2021 19:44:05 +0000 (20:44 +0100)]
Make UnsignedLongSet.Entry immutable

Having entries mutable is just a drag when transferring them to
mutable, as we need to perform deep copies. Let's turn them into
immutables and be done with it.

JIRA: CONTROLLER-2015
Change-Id: I3be807cbdf71a51e6b9506e0932857a230924986
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix UnsignedLongSet entry lifecycle 92/98392/2
Robert Varga [Wed, 10 Nov 2021 17:51:05 +0000 (18:51 +0100)]
Fix UnsignedLongSet entry lifecycle

When we are copying things around, we have to ensure we copy Entries,
because they cannot be shared.

JIRA: CONTROLLER-2015
Change-Id: I8a484a3bf52ffeaf4f4d0e770bc77dba31dbb221
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFix Eclipse compilation error 91/98391/1
Robert Varga [Wed, 10 Nov 2021 13:43:58 +0000 (14:43 +0100)]
Fix Eclipse compilation error

JDT has trouble with Scala classes here, make sure we specify
more general scala.collections.Set instead of its immutable counterpart.

Change-Id: I60b56e6b7ec5705409aee8d1e30a8ae9e5579bfb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoFixup assertions a bit 90/98390/1
Robert Varga [Wed, 10 Nov 2021 12:52:15 +0000 (13:52 +0100)]
Fixup assertions a bit

The tests are using different transaction mix, pass down explicit
expected transaction count.

Change-Id: I5007fe0ad90009fcafb727bac8d37bd07dfaae94
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoImprove tell-based protocol assumptions 89/98389/2
Robert Varga [Wed, 10 Nov 2021 11:34:30 +0000 (12:34 +0100)]
Improve tell-based protocol assumptions

Make failures a bit more visible by comparing human-readable things.

Change-Id: I682c020be348c61fcdf4c3f31949ba0f666af020
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoPartially enable testSingleTransactionsWritesInQuickSuccession() 80/98380/6
Robert Varga [Tue, 9 Nov 2021 20:02:31 +0000 (21:02 +0100)]
Partially enable testSingleTransactionsWritesInQuickSuccession()

Split the asserts into two methods, asserting the two datastore
options. The ask-based path remains disabled because it currently
fails tests.

Also improve tell-based protocol assertions, which need to wait
for the purge process to settle.

Change-Id: I8b2f3d84b2c7cd01dec4f7994eda716d022a98aa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup DistributedDataStoreRemotingIntegrationTest 82/98382/5
Robert Varga [Wed, 10 Nov 2021 06:33:12 +0000 (07:33 +0100)]
Cleanup DistributedDataStoreRemotingIntegrationTest

We have a few @Ignored tests and assumptions scattered a bit, perform
a general cleanup on them.

JIRA: CONTROLLER-1991
Change-Id: I70054276b5ffa179337a302e5d2498e925b65ce8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup JsonExportActor 86/98386/1
Robert Varga [Wed, 10 Nov 2021 10:18:19 +0000 (11:18 +0100)]
Cleanup JsonExportActor

Remove unneeded 'this.' qualifiers and using an
EffectiveStatementInference instead of SchemaPath when instantiating
JSON codec.

Change-Id: Iac6b980771c4ad395341a9c88ee0d16c34d8a02a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup ShardInformation 85/98385/1
Robert Varga [Wed, 10 Nov 2021 10:12:33 +0000 (11:12 +0100)]
Cleanup ShardInformation

Drop unneeded 'this.' qualifiers and use a simple return expression
in getSerializedLeaderActor().

Change-Id: I9a11410f8bc6d8246bacf99fa86c42de85c328ae
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup ShardWriteTransaction 84/98384/1
Robert Varga [Wed, 10 Nov 2021 10:10:52 +0000 (11:10 +0100)]
Cleanup ShardWriteTransaction

A few arguments can be made final and an if/else block can be
simplified.

Change-Id: Ib5464482b4e4cc1d73f755b4b467470fc3b2af25
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoClean up AbstractTransactionContextFactory 83/98383/3
Robert Varga [Wed, 10 Nov 2021 09:50:50 +0000 (10:50 +0100)]
Clean up AbstractTransactionContextFactory

Add a few @NonNull annotations and eliminate two else blocks.

Change-Id: Ide21c363f349af7b24fb4835b859a224357586c8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoExpose ImmutableList from FrontendClientMetadata 78/98378/1
Robert Varga [Tue, 9 Nov 2021 18:48:16 +0000 (19:48 +0100)]
Expose ImmutableList from FrontendClientMetadata

ImmutableList is an API contract, exposed it to callers.

Change-Id: I7fb2a09c2b225ce48ece7400128c8215d70292fe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoCleanup cds-access-api dependencies 77/98377/1
Robert Varga [Tue, 9 Nov 2021 18:31:28 +0000 (19:31 +0100)]
Cleanup cds-access-api dependencies

We are using Guava, declare that as a dependency.

Change-Id: Ibe905f0d2d87c5e7dfb4fad598acb27b4323c7b8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd MutableUnsignedLongSet.addAll() 72/98372/1
Robert Varga [Tue, 9 Nov 2021 10:23:05 +0000 (11:23 +0100)]
Add MutableUnsignedLongSet.addAll()

Add the ability to merge two UnsignedLongSets. This is useful when
we are using ImmutableUnsignedLongSet as a data interchange format
to communicate changes to a MutableUnsignedLongSet.

JIRA: CONTROLLER-2015
Change-Id: Ia84474b685872586722914f20db8f96a3c172f97
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoAdd UnsignedLongBitmap 10/98310/13
Robert Varga [Sat, 6 Nov 2021 15:04:48 +0000 (16:04 +0100)]
Add UnsignedLongBitmap

Rather than using a ImmutableMap<UnsignedLong, Boolean>, we can do
have a much denser representation with a specialized class. Here we
are introducing an explicit UnsignedLongBitmap, which stores an array
of longs and an array of booleans, ditching the intermediate objects.

Also clean up error reporting, throwing an IOException instead of a
VerifyException when things should go south unexpectedly.

JIRA: CONTROLLER-2013
Change-Id: Ie64da0af68ea2898dc77368afd4fce8abd2cccea
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoSprinkle @NonNull annotations 69/98369/2
Robert Varga [Mon, 8 Nov 2021 15:50:25 +0000 (16:50 +0100)]
Sprinkle @NonNull annotations

We have a few return methods which could use @NonNull annotations,
sprinkle them around.

Change-Id: I48c0f8879127673eb122321dd6c92d4572098f68
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoInline Entry.contains() 60/98360/1
Robert Varga [Mon, 8 Nov 2021 08:22:45 +0000 (09:22 +0100)]
Inline Entry.contains()

MutableUnsignedLongSet.add() has half of the check done in contains()
as an invariant. Inline the second part there, improving performance a
bit.

Thisleaves only UnsignedLongSet.contains() as the sole caller of
Entry.contains(). Inline it there, reducing the footprint a bit.

JIRA: CONTROLLER-2014
Change-Id: Ie38283a1fc46aff8fbc717a23aa9a068805636db
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 years agoRemove UnsignedLongSet.addImpl() 59/98359/1
Robert Varga [Mon, 8 Nov 2021 07:49:15 +0000 (08:49 +0100)]
Remove UnsignedLongSet.addImpl()

We now do not share utilities in UnsignedLongSet, hence relocate
implementation code to MutableUnsignedLongSet.add().

JIRA: CONTROLLER-2014
Change-Id: Id1578a8ea639ed512d55b2e6dca26de5abdf3ab0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>