controller.git
3 weeks agoRemove TransactionRateLimiter 26/115026/3
Robert Varga [Thu, 30 Jan 2025 08:08:33 +0000 (09:08 +0100)]
Remove TransactionRateLimiter

This component is completely unused. Remove it along with all its
surrounding wiring -- including marking its configuration as obsolete.

Change-Id: Ica980f21109ca80d19660a6327e00e10073c9610
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoSpecialize UnsignedLongSet.EntryImpl 25/115025/2
Robert Varga [Thu, 30 Jan 2025 07:02:58 +0000 (08:02 +0100)]
Specialize UnsignedLongSet.EntryImpl

Separate out the interface and implementations, so that we now have two
record covering the case of a singleton range or a range encompassing
multiple values.

Change-Id: I08e86f2f4e58c50734ec34433b946ceaa3f55b17
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoPromote UnsignedLong{Bitmap,Set} 24/115024/1
Robert Varga [Thu, 30 Jan 2025 06:17:01 +0000 (07:17 +0100)]
Promote UnsignedLong{Bitmap,Set}

Tracking unsigned long things is useful in RAFT context, not just where
sal-distributed-datastore is concerned.

Promote these utilities to cluster.raft.spi for wider exposure.

Change-Id: Iab9f9a326ee60101230b7a3130cc48134182c48f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoUse BindingMap.toMap() 15/115015/1
Robert Varga [Thu, 30 Jan 2025 01:19:45 +0000 (02:19 +0100)]
Use BindingMap.toMap()

We are collecting EntryObjects, we have a specialized utility to make
that easy.

Change-Id: I4920e20d42e4636ec151abd72fb36d7db37679dc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoUnify ActorUtils lookup 14/115014/1
Robert Varga [Thu, 30 Jan 2025 01:16:55 +0000 (02:16 +0100)]
Unify ActorUtils lookup

Use a simple utility method with a switch expression to return the
correct ActorUtils and use it where needed.

Change-Id: I7fefe74fb2d7706d5fb82bd091e214beba7ce3e9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoDo not use commons-lang3 for serialization 13/115013/2
Robert Varga [Wed, 29 Jan 2025 23:52:08 +0000 (00:52 +0100)]
Do not use commons-lang3 for serialization

The method we are using here is a plain wrapper around
ObjectOutputStream masking IOException. Just the two lines ourselves,
replacing use of FileOutputStream with java.nio.file.Files instead.

Change-Id: I07ed7b6303c1d1d7ffabc730eb89598c255e935f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoImprove duration formatting 12/115012/1
Robert Varga [Wed, 29 Jan 2025 22:58:31 +0000 (23:58 +0100)]
Improve duration formatting

DurationFormatUtils.formatDurationHMS() is not doing quite what we want
if we go for peers inactive for longer than 24 hours.

Replace this commons-lang3 dependency with a Duration+String.format()
solution, which caps the result at a millisecond-before-24-hours on
overflow. Also issue a warning if that happens.

Change-Id: Ic79062890dcb777a6d0cfd7f4bc49be98ff48f29
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoDitch use of ObjectUtils.identityToString() 11/115011/1
Robert Varga [Wed, 29 Jan 2025 22:29:24 +0000 (23:29 +0100)]
Ditch use of ObjectUtils.identityToString()

Use Objects.toIdentityString() instead, reducing reliance on
commons-lang3.

Change-Id: Ib6c6698ca1b33bf9aaef85c74c2df45a6a584897
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoClean up RaftActorBehaviour.canGrantVote() 10/115010/1
Robert Varga [Wed, 29 Jan 2025 21:10:55 +0000 (22:10 +0100)]
Clean up RaftActorBehaviour.canGrantVote()

We are using state variable and if/else blocks to change its initial
value. Rather than doing that, let's just return the appopriate result
as soon as we know it.

While we are here, store values we access multiple times in local
variables for brevity and simplicity.

Change-Id: I2c8eb29d617bf41d0451ae42d31b30e8f959774e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoImprove RaftActorBehavior.shouldUpdateTerm() 09/115009/1
Robert Varga [Wed, 29 Jan 2025 20:57:05 +0000 (21:57 +0100)]
Improve RaftActorBehavior.shouldUpdateTerm()

Use local variable type inference and Optional.isEmpty() to simplify
things.

Change-Id: I1ec28dd24f4eb9c36ddd0c20bf1140ef2509b15f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoAdd RaftActor.memberId() 08/115008/2
Robert Varga [Wed, 29 Jan 2025 18:06:33 +0000 (19:06 +0100)]
Add RaftActor.memberId()

Rename the protected getId() method to memberId() and make it public.
Deprecated persistenceId() for removal, as it will be gone when we ditch
persistence.

JIRA: CONTROLLER-2073
Change-Id: Id02ae441855556160ad4746eeb0a8774fa87c4aa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoDeprecate RaftActor.persistenceId() 07/115007/1
Robert Varga [Wed, 29 Jan 2025 18:01:58 +0000 (19:01 +0100)]
Deprecate RaftActor.persistenceId()

persistenceId() is something we inherit from AbstractPersistentActor,
which we are getting rid of.

Make RaftActor.getId() public as memberId() and use it instead of
persistenceId().

JIRA: CONTROLLER-2073
Change-Id: If8a76654e9d8102a41548883a90d680db833f9f8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoClean up RaftActor name handling 06/115006/1
Robert Varga [Wed, 29 Jan 2025 17:28:10 +0000 (18:28 +0100)]
Clean up RaftActor name handling

We have three concepts here:
- persistenceId, which is left to be defined by subclasses
- id, which gets passed to the constructor
- Shard.name, which is effectively the same thing

Eliminate the need to call overridable methods in constructor by
codifying the constructor id as persistenceId(), which is now a final
method in RaftActor.

Also prevent RaftActor.getId() from being overridden: this is the id
passed to constructor, even when we ditch persistence. We also eliminate
Shard.name, as it was always the same thing as getId().

Change-Id: I007964f8c17c5693bd96a030c4b75821d491254b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoReduce RaftActor method visibility 03/115003/1
Robert Varga [Wed, 29 Jan 2025 16:42:25 +0000 (17:42 +0100)]
Reduce RaftActor method visibility

We have a few protected methods which really should be
package-protected. Hide them from outside world.

JIRA: CONTROLLER-2073
Change-Id: I53cc6de8271d2425e15a9631170555214d67c828
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoStore ReplicatedLog reference 97/114997/2
Robert Varga [Wed, 29 Jan 2025 14:32:10 +0000 (15:32 +0100)]
Store ReplicatedLog reference

We are logging a number of things from the the replicated log, make sure
to keep the instance local.

Change-Id: I66961cb66046927c4805ff9f6cd931b11d7cc509
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoCentralize lz4-java version 96/114996/1
Robert Varga [Wed, 29 Jan 2025 14:19:37 +0000 (15:19 +0100)]
Centralize lz4-java version

Do not hide the version in sal-clustering-commons, keep it in
bnd-parent.

Change-Id: I0f1f1240cb616bd547c2fdc852d277798ea6fff3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoAdd Automatic-Module-Name to sal-clustering-commons 81/114981/3
Robert Varga [Tue, 28 Jan 2025 20:43:28 +0000 (21:43 +0100)]
Add Automatic-Module-Name to sal-clustering-commons

Make it easier on downstreams to consume this artifact by explicitly
downgrading m-j-d version.

While we are here, also reformat and re-parent to bundle-plugin instead
of mdsal-plugin, as we do not have any codegen here.

Change-Id: Id40df7c6e1259b8d0c6142667464982763c85b9f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoClean up AbstractReplicatedLog 72/114972/3
Robert Varga [Tue, 28 Jan 2025 15:22:21 +0000 (16:22 +0100)]
Clean up AbstractReplicatedLog

The string we get is tied to RaftActorContext.getId(), let's call it
logId, just as we do in LocalAccess.

Force subclasses to provide initial data, so that it is clear the
magic values we are using are for test/mock classes -- which now specify
them explicitly.

Use List.of() instead of Collections.emptyList() as a final touch.

JIRA: CONTROLLER-2073
Change-Id: I784d02ecc55b668e2d991db6d6ff4e109e033d52
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoUse bnd-parent in raft-journal 80/114980/2
Robert Varga [Tue, 28 Jan 2025 20:08:23 +0000 (21:08 +0100)]
Use bnd-parent in raft-journal

raft-journal is a simple JPMS API component at this point. Use
bnd-parent to package it. Also fix javadocs while we are at it.

Change-Id: Ib821ea720f80edcd87dbdb528366b4599dbd9d3e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoAdd bnd-parent and use it in blueprint 79/114979/2
Robert Varga [Tue, 28 Jan 2025 19:53:10 +0000 (20:53 +0100)]
Add bnd-parent and use it in blueprint

bnd-parent is essentially the same thing as bundle-parent, except driven
by bnd-maven-plugin.

This allows us to use annotations to control the manifest layout,
significantly improving maintainability.

Change-Id: I47dad895b7c3db907b6272827f57f84e933cb836
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoRename AbstractReplicatedLogImpl 71/114971/2
Robert Varga [Tue, 28 Jan 2025 15:00:58 +0000 (16:00 +0100)]
Rename AbstractReplicatedLogImpl

AbstractReplicatedLog better captures the intent, let's use that without
implying anything about ReplicatedLogImpl itself.

JIRA: CONTROLLER-2073
Change-Id: I14abc64495a92476258eb07c3f6915a77afbbf00
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoUse bundle-parent in blueprint 78/114978/1
Robert Varga [Tue, 28 Jan 2025 19:18:28 +0000 (20:18 +0100)]
Use bundle-parent in blueprint

Just inherit the things from bundle-parent, reducing maintenance
overhead.

Change-Id: I4ee826f6aa50363f36db2352fa88b9c93b3bec18
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoBump upstreams 77/114977/1
Robert Varga [Tue, 28 Jan 2025 19:12:12 +0000 (20:12 +0100)]
Bump upstreams

Adopt:
- yangtools-14.0.7
- mdsal-14.0.8

Change-Id: Ie64ae6015793088bede41d3d8c7e931befb2c964
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoAcquire persistence provider once 68/114968/2
Robert Varga [Tue, 28 Jan 2025 14:03:14 +0000 (15:03 +0100)]
Acquire persistence provider once

We have a few places where we call getPersistenceProvider() twice. Make
things clearer by acquiring it only once.

JIRA: CONTROLLER-2073
Change-Id: Ic4bc681140076396b5d3384b1a7386aa00ee3e8a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoInline isPersistentPayload() 67/114967/2
Robert Varga [Tue, 28 Jan 2025 13:59:19 +0000 (14:59 +0100)]
Inline isPersistentPayload()

The only caller already accesses entry data, so let's inline this method
and also clean up onRecoveredJournalLogEntry() a bit.

JIRA: CONTROLLER-2073
Change-Id: I5be0d85631692612bdaa284dcd132232c2ca744a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoClean up RaftActorDelegatingPersistentDataProviderTest 66/114966/2
Robert Varga [Tue, 28 Jan 2025 13:42:35 +0000 (14:42 +0100)]
Clean up RaftActorDelegatingPersistentDataProviderTest

We use unchecked casts and raw types. Modernize the setup a bit,
eliminating the need for suppressions.

JIRA: CONTROLLER-2073
Change-Id: Idb0c31e66de3721b9bf9ecf46b8c9484748a287f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoAdd cluster.raft.LocalAccess 61/114961/1
Robert Varga [Mon, 27 Jan 2025 19:11:07 +0000 (20:11 +0100)]
Add cluster.raft.LocalAccess

Current layout of state management needs some better encapsulation, i.e.
something RaftActor sees from local storage perspective. One aspect
is TermInfoStore, as tied logId.

Introduce LocalAccess to maintain a combination of a TermInfoStore and a
logId.

Tests are migrated so that the test suites not involved with persistence
use the newly-improved TestTermInfoStore, or FailingTermInfoStore if
they want to assert that persistence was not called.

Common path with RaftActor is exposed via the
DataPersistenceProvider-based constructor, allowing those involving
persistence call out into that path to improve consistency.

JIRA: CONTROLLER-2133
Change-Id: I5960036b599f76b284d53d60bbdf8a58c706f290
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoSplit ImmutableUnsignedLongSet.readFrom() 60/114860/3
Robert Varga [Tue, 7 Jan 2025 18:32:57 +0000 (19:32 +0100)]
Split ImmutableUnsignedLongSet.readFrom()

We have two methods of reading entries. Split them into separate
methods, making things a tad easier to follow.

Ditch use of ArrayList, as using Entry[] results in a better path
to ImmutableSortedSet.construct().

Change-Id: I0c91fc0b07d5b9e10f4ba03454ebff5237b20da3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoDo not use Collections2 58/114858/3
Robert Varga [Tue, 7 Jan 2025 17:19:15 +0000 (18:19 +0100)]
Do not use Collections2

Building an ImmutableRangeSet through copyOf() offers to advantages over
using an explicit Builder -- it literally is the same thing.

Ditch Collections2.transform() in favor of a simple loop of
Builder.add() calls, resulting in more performant code.

Change-Id: I700b4d6d3082fed6413d8762085d6971285bdb66
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoRefactor UnsignedLongSet.Entry 57/114857/3
Robert Varga [Tue, 7 Jan 2025 17:06:11 +0000 (18:06 +0100)]
Refactor UnsignedLongSet.Entry

Hide this class and make it a record, as that is what it is.

Change-Id: I7ccaa219590b2bf2c7ea880c8e2e185165272a5f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoUse switch expressions in UnsignedLongBitmap 50/114850/3
Robert Varga [Tue, 7 Jan 2025 15:59:38 +0000 (16:59 +0100)]
Use switch expressions in UnsignedLongBitmap

Both copyOf() and readFrom() dispatch based on size, always returning an
instance. Use a switch expression to express that, improving code layout
a bit.

Change-Id: I25247537e7a55bf0e3710fe8d70e2a1dd8a4d6f2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoClean up UnsignedLongSet.Entry.equals() 53/114853/3
Robert Varga [Tue, 7 Jan 2025 16:12:18 +0000 (17:12 +0100)]
Clean up UnsignedLongSet.Entry.equals()

Use an instanceof pattern to squash the implementation into a single
expression.

Change-Id: I2b1562a4e7e30559f3e439150b21ad267c4f188a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoImprove UnsignedLongSet.toString() 56/114856/3
Robert Varga [Tue, 7 Jan 2025 16:27:38 +0000 (17:27 +0100)]
Improve UnsignedLongSet.toString()

Use arrow form, documenting the explicit no-op on empty.

Change-Id: I486c55a1764666fd7738c3fac67d276f0f47e3ed
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoImprove UnsignedLongSet.equals() 54/114854/3
Robert Varga [Tue, 7 Jan 2025 16:12:58 +0000 (17:12 +0100)]
Improve UnsignedLongSet.equals()

Use instanceof pattern to eliminate an explicit cast.

Change-Id: I5f928238056fc85511e96a5a8010531e598d2bef
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoDefer empty UnsignedLongBitmap instantiation 52/114852/3
Robert Varga [Tue, 7 Jan 2025 16:05:51 +0000 (17:05 +0100)]
Defer empty UnsignedLongBitmap instantiation

Move the EMPTY singleton in Regular, so that we instantiate it only when
needed.

Change-Id: Ib70d3c3c5dd5aea4f82efc485998248a8ff54ec1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoSeal UnsignedLongSet 55/114855/2
Robert Varga [Tue, 7 Jan 2025 16:14:49 +0000 (17:14 +0100)]
Seal UnsignedLongSet

We have only two internal implementations, make sure this is enforced in
class hierarchy.

Change-Id: I01338e132929784ac2671af0cc7439364136e685
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoSeal UnsignedLongBitmap 51/114851/2
Robert Varga [Tue, 7 Jan 2025 16:03:08 +0000 (17:03 +0100)]
Seal UnsignedLongBitmap

We only allow our two internal implementations, make that explicit by
sealing the class hierarchy.

Change-Id: I44d7ea88b38b48688bf18362ff44bdaccbe8c612
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoUse HashMap.newHashMap() in UnsignedLongBitmap 45/114845/1
Robert Varga [Tue, 7 Jan 2025 13:47:59 +0000 (14:47 +0100)]
Use HashMap.newHashMap() in UnsignedLongBitmap

We have a replacement for Maps.newHashMapWithExpectedSize(), use it.

Change-Id: I75ffa21fe23732c176e50ec968258ae9fda761a8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoSimplify UnsignedLongBitmap.mutableCopy() 44/114844/1
Robert Varga [Tue, 7 Jan 2025 13:46:42 +0000 (14:46 +0100)]
Simplify UnsignedLongBitmap.mutableCopy()

We only check for empty size, so use an if to peel this case.

Change-Id: I70b497a12098d2fffe601593ec2cf0852ef261c0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoOptimize UnsignedLongBitmap.equals() 43/114843/1
Robert Varga [Tue, 7 Jan 2025 13:44:29 +0000 (14:44 +0100)]
Optimize UnsignedLongBitmap.equals()

Use instanceof pattern to simplify the two implementations down to a
single expression.

Change-Id: I1eda90f4e98bedbc482b469be9c221a7c50080a3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoUse Path.resolve() in mdsal-it-base 32/114832/1
Robert Varga [Tue, 7 Jan 2025 11:37:23 +0000 (12:37 +0100)]
Use Path.resolve() in mdsal-it-base

Improve path management by spelling out components.

Change-Id: Ibde6c604dc5157749171973c187402bacdc297a0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 months agoBump upstream 11/114611/2
Robert Varga [Sat, 30 Nov 2024 11:56:06 +0000 (12:56 +0100)]
Bump upstream

Adopt:
- odlparent-14.0.5
- yangtools-14.0.6
- mdsal-14.0.6

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

2 months agoMove ApplyLeaderSnapshot 09/114509/2
Robert Varga [Fri, 22 Nov 2024 12:40:28 +0000 (13:40 +0100)]
Move ApplyLeaderSnapshot

This record is really an SnapshotManager-internal message, reduce make
sure it is defined within it.

JIRA: CONTROLLER-2135
Change-Id: I82a3ac2b51e9b36943147ffe4f54b6010aff85ff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoUse Awaitility in ShardTest 97/114497/1
Robert Varga [Thu, 21 Nov 2024 10:07:07 +0000 (11:07 +0100)]
Use Awaitility in ShardTest

Let's not brew our own code to wait for an assertion, just use
Awaitility.await() instead.

Change-Id: Ic62ea5325cde86f6ea3a41dd5da7a8d53d188280
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoMove snapshot parsing to ShardManager 67/114467/15
Robert Varga [Tue, 12 Nov 2024 19:38:02 +0000 (20:38 +0100)]
Move snapshot parsing to ShardManager

ApplySnapshot is an asynchronous triggered via a message-to-self. This
means that if we are being particularly slow about installing a snapshot
from leader, we could end up parsed user state to be present multiple
times in the pipeline.

Move user state parsing from Follower to ShardManager, so that it
remains in its ByteSource form until we are ready to process it --
thus containing the heap allocation and its application as an atomic
actor work unit.

JIRA: CONTROLLER-2135
Change-Id: I8f09709a8e38bf5a959ef5f02eb8d8377d8399d5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRefactor SnapshotManager 66/114466/13
Robert Varga [Tue, 12 Nov 2024 21:51:33 +0000 (22:51 +0100)]
Refactor SnapshotManager

The state keeping here is atrocious: the class is implemented as a
forwarder to current behavior and the actual implementations are hidden
behind a screen of default implementations.

This patch introduces SnapshotManager.Task as the core state-keeping
anchor. We then have a couple of records which hold state related to the
task.

This flushes out the fact we really have two different persisting paths,
depeding on what triggered it.

JIRA: CONTROLLER-2135
Change-Id: I9b667994d6f3d83ed3cffe3c7375978fb26d68c5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoImprove ImmutableRaftEntryMeta 94/114494/2
Robert Varga [Tue, 19 Nov 2024 19:23:08 +0000 (20:23 +0100)]
Improve ImmutableRaftEntryMeta

We really what this to be a value type, hence we are following the lead
of the likes of java.lang.Integer. The constructor is indicidental to
the implementation -- we will remove it as soon as we can be a proper
value type.

Change-Id: I42f8a682e20cc37e50e1c34e0f10cce9c282708a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoDo not use Collections.emptyList() 74/114474/2
Robert Varga [Thu, 14 Nov 2024 10:11:03 +0000 (11:11 +0100)]
Do not use Collections.emptyList()

Use List.of() instead.

Change-Id: If213252489cb4ad4d0ecf4f01ca1b89affc8a29e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoUse TermInfo in Snapshot serialization 72/114472/1
Robert Varga [Thu, 14 Nov 2024 08:33:35 +0000 (09:33 +0100)]
Use TermInfo in Snapshot serialization

Eliminate use of legacy methods in favorof talking to TermInfo directly.

JIRA: CONTROLLER-2127
Change-Id: I5a932c0b6bbc785b99e681168f2631b05cf0f900
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoMake ApplySnapshot a record 64/114464/5
Robert Varga [Tue, 12 Nov 2024 18:37:36 +0000 (19:37 +0100)]
Make ApplySnapshot a record

This is purely-internal DTO, make it a record.

Change-Id: I4570d9a78362f4dff7d4aceb4b469652396d3643
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoClean up State.toString() 71/114471/2
Robert Varga [Wed, 13 Nov 2024 14:42:42 +0000 (15:42 +0100)]
Clean up State.toString()

We are about to give up tight control over toString() callers, let's
make sure we do not cause OOM hazards.

Change-Id: I0d362b03ec4a66cc7bdd56f4ae72d2c1b7ce7f10
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoPromote RaftEntryMeta 65/114465/2
Robert Varga [Tue, 12 Nov 2024 20:17:01 +0000 (21:17 +0100)]
Promote RaftEntryMeta

This is a well-defined interface, add an immutable implementation
and publish both in raft.spi.

Change-Id: I701427b6adeb6098278ad3d7fdccd2716f8801ee
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRefactor handleSnapshotMessage() 63/114463/1
Robert Varga [Tue, 12 Nov 2024 19:48:40 +0000 (20:48 +0100)]
Refactor handleSnapshotMessage()

Use a switch with patterns to dispatch the messages. This forces a
reasonable refactor of COMMIT_SNAPSHOT.

Change-Id: Ia50f92c7129b888ab6c4a7743945a8f17cf55326
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRefactor sendSnapshotChunk() 62/114462/1
Robert Varga [Tue, 12 Nov 2024 17:53:59 +0000 (18:53 +0100)]
Refactor sendSnapshotChunk()

Use Optional.isEmpty() to guard an early return. Then minimize the size
of the try/catch block, resuling in another possible early return.

Take advantage of the fields we are accessing, so that we get their
reuse -- which also improves clarity, as we use names that correspond to
InstallSnapshot fields.

JIRA: CONTROLLER-2074
Change-Id: Ibb2f6d9e6be726c2346f6b8358899eae56f7ac21
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoInline sendSnapshotChunk() 61/114461/1
Robert Varga [Tue, 12 Nov 2024 17:35:07 +0000 (18:35 +0100)]
Inline sendSnapshotChunk()

The only caller of this has already much of what is needed at its disposal,
eliminating the need to unwrap snapshotHolder.

Change-Id: Ia99a3baa7f731c3a816a6dd21a6ee1d71cb200bd
JIRA: CONTROLLER-2074
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoFix intermittent RecoveryIntegrationTest failures 32/99432/7
Tomas Cere [Tue, 25 Jan 2022 11:47:13 +0000 (12:47 +0100)]
Fix intermittent RecoveryIntegrationTest failures

Looks like the two final tell() calls to the leader actor
can be misordered sometimes(perhaps no ordering guaranteed when
outside of actors?). So fix this by waiting until the leader
updates its journal before sending the next payload.

JIRA: CONTROLLER-2024
Change-Id: Icd86ea4e0f45589c0c514b805d6ef5491bf796b3
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
3 months agoRefactor to get rid of @SuppressFBWarnings 14/114414/4
Robert Varga [Mon, 11 Nov 2024 10:24:16 +0000 (11:24 +0100)]
Refactor to get rid of @SuppressFBWarnings

Make sure getContext() is final, so that it can be safely called from
the constructor.

Change-Id: Ic733d70e82ab9d36127d3c88974d4b30f96bf05c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoMigrate callers of Actor.getSelf() 24/114424/2
Robert Varga [Mon, 11 Nov 2024 09:39:14 +0000 (10:39 +0100)]
Migrate callers of Actor.getSelf()

self() is a final method, making it okay to use in constructor.
Mass-migrate all callers to keep consistency.

Change-Id: I697e0722b1ba5af694692ebbc859f65c4a709c05
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoEliminate CheckConsensusReached 05/114405/1
Robert Varga [Sun, 10 Nov 2024 20:42:47 +0000 (21:42 +0100)]
Eliminate CheckConsensusReached

This is a direct callout from RaftActor to behavior, pretending to be a
message. Add an explicit method instead.

Change-Id: I0f059f1abbe7e9769c9d8288816e67b364f70217
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoTurn SwitchBehavior into a record 00/114400/2
Robert Varga [Fri, 8 Nov 2024 12:23:38 +0000 (13:23 +0100)]
Turn SwitchBehavior into a record

This is a plain DTO, use a record for that, inforcing non-null newState.

Change-Id: I92920303b9a8a8c00c4f31eec23b57b976945b5b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoMake SwitchShardBehavior a record 99/114399/2
Robert Varga [Fri, 8 Nov 2024 12:18:06 +0000 (13:18 +0100)]
Make SwitchShardBehavior a record

This is a plain DTO, use a record for that.

Change-Id: Ic388ce17c6f88a56b72423f963c89da226bce627
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRemove deprecated TermInfo methods 98/114398/1
Robert Varga [Fri, 8 Nov 2024 12:06:25 +0000 (13:06 +0100)]
Remove deprecated TermInfo methods

This makes a pass at cleaning up methods.

JIRA: CONTROLLER-2127
Change-Id: Ie218f74bcb59d1a4e5b354d62f9b25ea5349a449
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRename cluster.raft.ElectionTerm 94/114394/3
Robert Varga [Fri, 8 Nov 2024 01:36:10 +0000 (02:36 +0100)]
Rename cluster.raft.ElectionTerm

This interface really specifies a storage engine, rename it to
raft.spi.TermInfoStore.

JIRA: CONTROLLER-2127
Change-Id: Id295cd43642d525905ccab8b8bf0c29e2c13ec24
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoIntroduce cluster.raft.spi.TermInfo 80/113580/10
Robert Varga [Thu, 7 Nov 2024 21:45:48 +0000 (22:45 +0100)]
Introduce cluster.raft.spi.TermInfo

ElectionTerm is quite overloaded: it conflates the definition of
term+votedFor and lifecycle for updating it.

This patch introduces TermInfo as the holder of term+votedFor, leaving
ElectionTerm to be the lifecycle management part.

This ends up cleaning up quite a few interactions, as we usually
interchange atomic TermInfo, not its constituent parts.

JIRA: CONTROLLER-2127
Change-Id: I456a85dc96a01627c89a74d57520a8179dc9b4f9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoModernize DataServiceIT 93/114393/2
Robert Varga [Thu, 7 Nov 2024 17:30:54 +0000 (18:30 +0100)]
Modernize DataServiceIT

Clean up builder use, use local variable type inference,
Optional.orElseThrow() and DataObjectIdentifier.

Change-Id: Iafbc742e936cc98679fc048134abaf69599d7c81
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoLock down RaftActorBehavior state 92/114392/1
Robert Varga [Thu, 7 Nov 2024 17:05:19 +0000 (18:05 +0100)]
Lock down RaftActorBehavior state

A number of things:
- drop 'protected' pretense: we are only serving our package
- expose logName directly
- mark a number of methods final

Change-Id: I46f131fc837388e3e418eb13273c755909bb17af
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoEliminate AbstractRaftActorBehavior 91/114391/2
Robert Varga [Thu, 7 Nov 2024 16:00:27 +0000 (17:00 +0100)]
Eliminate AbstractRaftActorBehavior

The split here is quite ugly. Unify (Abstract)RaftActorBehavior and seal
AbstractLeader to enforce consistency.

Change-Id: Ia292b13848ff95ad968c3946db64cf0cd923f979
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRefactor RaftRPC.toString() 89/114389/1
Robert Varga [Thu, 7 Nov 2024 11:45:11 +0000 (12:45 +0100)]
Refactor RaftRPC.toString()

Force a unified layout of toString(), which makes it easier to evolve
subclasses' fields.

Change-Id: I409ffe766feea88f8f935328aa0188dbc0df6bcd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoEliminate AbstractRaftRPC 88/114388/1
Robert Varga [Thu, 7 Nov 2024 11:18:31 +0000 (12:18 +0100)]
Eliminate AbstractRaftRPC

The RaftRPC/AbstractRaftRPC split is artificial, let's merge the two
classes, which allows us to seal the entire hierarchy.

Change-Id: I2b50200e7ab286881c63865940db5d866dbda942
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoModernize CandidateTest 87/114387/1
Robert Varga [Thu, 7 Nov 2024 11:10:05 +0000 (12:10 +0100)]
Modernize CandidateTest

Eliminate an explicit cast in CandidateTest and use List.of().

Change-Id: Ibd7937c8f384023ba58b1cc1c30beb4803abb2fb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoDo not use Optional in InstallSnapshot 57/114357/1
Robert Varga [Wed, 6 Nov 2024 17:22:17 +0000 (18:22 +0100)]
Do not use Optional in InstallSnapshot

Passing an Optional in method arguments is an early-adopter antipattern,
as is storing it in the fields. Use a plain @Nullable, which makes it a
tad easier to use.

Change-Id: I1acb67d38bb2be561cbc77041a9a1e07ed004b88
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRefactor handleInstallSnapshotReply() 39/114339/7
Robert Varga [Mon, 4 Nov 2024 11:29:53 +0000 (12:29 +0100)]
Refactor handleInstallSnapshotReply()

We are about to make a few changes to the logic here. Refactor it to
reduce nesting.

JIRA: CONTROLLER-2074
Change-Id: Icb373735fc5960e54b33483994500bfe034ecdf7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRefactor handleInstallSnapshot() 40/114340/3
Robert Varga [Mon, 4 Nov 2024 12:50:39 +0000 (13:50 +0100)]
Refactor handleInstallSnapshot()

We are about to make some changes to the logic here, but before we
embark on that, this patch makes the method more linear, differentiating
the two failure paths.

JIRA: CONTROLLER-2074
Change-Id: Iffc7d494e2f83968c5193dd2d3758d68443a6f6e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRemove unneeded SuppressFBWarnings 38/114338/1
Robert Varga [Mon, 4 Nov 2024 11:31:40 +0000 (12:31 +0100)]
Remove unneeded SuppressFBWarnings

handleInstallSnapshotReply() is no longer triggering the violation,
remove the annotation.

Change-Id: I7516ca3f635531c6055bde76134b8312f1f0369b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRefactor ShardManagerIdentifier 36/114336/1
Robert Varga [Mon, 4 Nov 2024 08:53:01 +0000 (09:53 +0100)]
Refactor ShardManagerIdentifier

- make this class a plain record, as it only holds a single field
- separate out toString() and toActorName() -- while the two are
  aliases, we want to have an explicit method
- move to cluster.datastore.shardmanager

Change-Id: Iceea5ea40e46ccf2f0d0a5c830a5d11c28cd57d4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoModernize DataTreeCohortRegistrationProxy 35/114335/1
Robert Varga [Sun, 3 Nov 2024 22:23:48 +0000 (23:23 +0100)]
Modernize DataTreeCohortRegistrationProxy

Use Pekko Java API where possible and reduce ceremony around
asynchronous execution.

Change-Id: Ia875b6dd454b675974b2e070c4b07f465084ba1c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoExpose ExecutionContextExecutor from Dispatches 34/114334/1
Robert Varga [Sun, 3 Nov 2024 22:16:46 +0000 (23:16 +0100)]
Expose ExecutionContextExecutor from Dispatches

Akka/Pekko has seamless integration with Java 8 via CompletionStages,
Duration etc. In order to make it useful, we also need a proper
Executor, not ExecutionContext.

As it turns out, this is as simple as exposing ExecutionContextExecutor
from our underlying MessageDispatcher.

Change-Id: Iadad1ccc12b40ba0716cd438d89c9b47643b0f14
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoUse exhaustive switch in CompositeDataTreeCohort 33/114333/2
Robert Varga [Sun, 3 Nov 2024 21:45:34 +0000 (22:45 +0100)]
Use exhaustive switch in CompositeDataTreeCohort

Eliminate an impossible branch, improving our defensiveness. Also fix a
typo in enum member name.

Change-Id: Ie9b6a51f76f3b1e2efb494edd1c6c4847457c6f0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRework FrontendReadWriteTransaction state tracking 32/114332/3
Robert Varga [Sun, 3 Nov 2024 19:12:13 +0000 (20:12 +0100)]
Rework FrontendReadWriteTransaction state tracking

Use switch expressions in most places and throw concrete ISEs, so
that it is apparent from the message as to what is going on.

JIRA: CONTROLLER-2131
Change-Id: Ib23ffe5baa3a97232f6f6cf6cbc6f38f109b443f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRemove abortFromTransactionActor() 31/114331/1
Robert Varga [Sun, 3 Nov 2024 17:13:46 +0000 (18:13 +0100)]
Remove abortFromTransactionActor()

We do not have ShardTransaction, hence this code path is completely
unused. Remove it.

JIRA: CONTROLLER-2129
Change-Id: I6709bcde470153dc63072f7ae95519e82fe3355d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoFix an Akka reference 23/114323/1
Robert Varga [Sun, 3 Nov 2024 10:15:09 +0000 (11:15 +0100)]
Fix an Akka reference

We really mean Pekko here.

Change-Id: I3f4f891b84c77a1da720407c2add012dec14139a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoBump Scala to 2.13.15 19/114319/1
Robert Varga [Sun, 3 Nov 2024 09:10:43 +0000 (10:10 +0100)]
Bump Scala to 2.13.15

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

Change-Id: I076d60bbb7a2295adf58cc76b4c50a05080d8e83
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoBump scalatestplus.junit-4-13_2.13 to 3.2.19.0 18/114318/1
Robert Varga [Sun, 3 Nov 2024 09:00:11 +0000 (10:00 +0100)]
Bump scalatestplus.junit-4-13_2.13 to 3.2.19.0

https://www.scalatest.org/release_notes/3.2.14
https://www.scalatest.org/release_notes/3.2.15
https://www.scalatest.org/release_notes/3.2.16
https://www.scalatest.org/release_notes/3.2.17
https://www.scalatest.org/release_notes/3.2.18
https://www.scalatest.org/release_notes/3.2.19

Change-Id: I291322f0f29e4e1bf926f9adfc9a473dbf42596e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoDitch scala-java8-compat 11/114311/3
Robert Varga [Sat, 2 Nov 2024 23:09:41 +0000 (00:09 +0100)]
Ditch scala-java8-compat

We have migrated away from using scala-java8-compat, remove the
dependency.

Change-Id: Ia11c9aa68ec8a47b54ea3fae2d63d323c8a2b2ae
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoMigrate away from scala.compat.java8.FutureConverters 10/114310/3
Robert Varga [Sat, 2 Nov 2024 23:03:53 +0000 (00:03 +0100)]
Migrate away from scala.compat.java8.FutureConverters

Use an OnComplete to dispatch the future without the use of
FutureConverters.

While we are here, also clean up interactions with
scala.concurrent.Future, so that we do not reference various
Promise-based things.

Change-Id: Iae5ff9e44ef4017409db66d34df4b00df919b68f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoAdd ShardDataTree.retire() 03/114303/11
Robert Varga [Sat, 2 Nov 2024 16:13:43 +0000 (17:13 +0100)]
Add ShardDataTree.retire()

The only reason for cohortIterator() is retiring a client. Encapsulate
the logic in ShardDataTree.

JIRA: CONTROLLER-2131
Change-Id: I45a3c48a5e462469f1f2919dfb180ca8d33c72ba
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoReduce use of Scala in ShardDataTreeListenerInfoMXBeanImpl 14/114314/3
Robert Varga [Sun, 3 Nov 2024 01:44:36 +0000 (02:44 +0100)]
Reduce use of Scala in ShardDataTreeListenerInfoMXBeanImpl

Use CompletionStages, even when they are a pain for this particular use
case.

Change-Id: I49ff00fd86df025174533e024092f5a3048250df
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoModernize CompositeDataTreeCohort 07/114307/6
Robert Varga [Sat, 2 Nov 2024 17:42:52 +0000 (18:42 +0100)]
Modernize CompositeDataTreeCohort

Use the various Java features to simplify code. Also use @Nullable
instead of optional, as it leads to simpler callers.

Also use scala.jdk.javaapi.FutureConverters instead of legacy
scala.compat.java8.FutureConverters, with routing through
callbackExecutor.

JIRA: CONTROLLER-2131
Change-Id: I2a47d01ab95862efeef40debd52e8f6ca40b601d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRename (Simple)ShardDataTreeCohort 99/114299/8
Robert Varga [Sat, 2 Nov 2024 11:31:36 +0000 (12:31 +0100)]
Rename (Simple)ShardDataTreeCohort

Let us use (Simple,Chained}CommitCohort naming throughout, so that do
not need to deal with a mouthful.

JIRA: CONTROLLER-2131
Change-Id: I04a37e000af74f087786c6f4fc8cee8ebdfe7c50
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRefactor ShardDataTreeCohort 98/114298/8
Robert Varga [Sat, 2 Nov 2024 10:15:16 +0000 (11:15 +0100)]
Refactor ShardDataTreeCohort

Move all logic from SimpleShardDataTreeCohort into ShardDataTreeCohort,
so we can use ChainedCommitCohort in ShardDataTree queues.

This leads to a consistent view of cohorts, i.e.
ShardDataTreeTransactionChain.createReadyCohort() returns the same
cohort as is present it the queue.

JIRA: CONTROLLER-2131
Change-Id: Idb391ce8db69ddfcf530e7679761de414df0165e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoEliminate ShardDataTree.CommitEntry 94/114294/6
Robert Varga [Fri, 1 Nov 2024 14:34:34 +0000 (15:34 +0100)]
Eliminate ShardDataTree.CommitEntry

We are only ever carrying SimpleShardDataTreeCohorts and keep additional
last access time.

Integrate the last access time into SimpleShardDataTreeCohort,
eliminating one level of indirection.

JIRA: CONTROLLER-2131
Change-Id: I3a1e7be49cc0ddcdb92e90e37ce17489ebeaa139
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRefactor ShardDataTree.processNextPending() 93/114293/6
Robert Varga [Fri, 1 Nov 2024 11:04:14 +0000 (12:04 +0100)]
Refactor ShardDataTree.processNextPending()

This is a match with possible removal of stale entries. Reduce confusion
by renaming it to findFirstEntry() and returning a nullable CohortEntry.

Callers then perform a simple null check instead of passing down a
lambda.

JIRA: CONTROLLER-2131
Change-Id: I39e35b6374ef1aa6d6c0c8bc2e32dd4d91263de6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoCentralize StandaloneFrontendHistory identifier 97/114297/1
Robert Varga [Sat, 2 Nov 2024 09:42:57 +0000 (10:42 +0100)]
Centralize StandaloneFrontendHistory identifier

We have three callsites using historyId == 0. Centralize this assumption
in a dedicated method.

JIRA: CONTROLLER-2131
Change-Id: I36a02be078c6e9ad96fef44eee13283d00322562
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoFrontendClientMetadata is a plain record 92/114292/4
Robert Varga [Fri, 1 Nov 2024 10:12:02 +0000 (11:12 +0100)]
FrontendClientMetadata is a plain record

This is an immutable DTO: annotate it and make it a record.

Change-Id: I19ad27fad4821a86c6742b48cc1b41638ad60503
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRemove FrontendClientMetadataBuilder.Disabled 91/114291/3
Robert Varga [Fri, 1 Nov 2024 09:59:22 +0000 (10:59 +0100)]
Remove FrontendClientMetadataBuilder.Disabled

Since metadata tracking cannot be disabled, it does not make sense to
have two implementations. Remove .Disabled and inline .Enabled into
FrontendClientMetadataBuilder, making it a final class.

Also improve annotations a bit.

Change-Id: Ie39ff1aa1a082fbf2714daa9dfcda49374f48b2d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoEliminate Ask-based messages 23/114223/33
Robert Varga [Mon, 28 Oct 2024 00:28:37 +0000 (01:28 +0100)]
Eliminate Ask-based messages

Since we are not servicing the messages, we can remove them.

JIRA: CONTROLLER-2129
Change-Id: Ia46ae004ef42391ee772891bdd7c63d666ae8456
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoEliminate ask-based support from Shard 20/114220/33
Robert Varga [Mon, 28 Oct 2024 00:19:38 +0000 (01:19 +0100)]
Eliminate ask-based support from Shard

This eliminates all the moving pieces in production code, leaving only
messages.

We also remove the remaining tests, notably ShardCommitCoordinationTest,
ShardTransactionFailureTest and ShardTransactionTest.

Replacement for ShardCommitCoordinationTest will come via a separate
issue, as we need to revisit how ShardDataTree.pendingTransactions work,
now that we only have properly-coordinated can-commit/pre-commit stages.

Replacement for ShardTransaction(Failure)Test will be submitted in a
separate patch.

JIRA: CONTROLLER-2129
Change-Id: I0161f0291fc5b27779c8304456cac800ac7c9e90
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRemove unnecessary checkReady() 90/114290/1
Robert Varga [Fri, 1 Nov 2024 08:46:40 +0000 (09:46 +0100)]
Remove unnecessary checkReady()

We have already asserted state and have tthe ready handle -- use it
directly without touching state again.

Change-Id: Ic227300e83bb2171a8ed287aa5e007f8edd12aed
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoRemove ActorUtils.broadcast() 83/114283/2
Robert Varga [Thu, 31 Oct 2024 10:44:59 +0000 (11:44 +0100)]
Remove ActorUtils.broadcast()

This method is not used anywhere: remove it.

Change-Id: Icf3bb19517516685e1ce6149123a7f5c4a57d1d0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 months agoIsolate Actor.getSender() references 73/114273/2
Robert Varga [Wed, 30 Oct 2024 16:32:18 +0000 (17:32 +0100)]
Isolate Actor.getSender() references

We *really* want to use replyTo-in-request pattern, so that we can
disconnect actors from their behaviours (a la Akka Typed).

In order to do that, we must get a handle on which places are relying on
Actor.sender() and hence this patch.

We mass-migrate callers of Actor.sender() to Actor.getSender() and
override AbstractActor.getSender() to be deprecated for removal -- which
flags all callsites with a deprecation warning.

Change-Id: Ib62d3ce90e8a345ea54c88f226ba0507676ef89c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>