Unconditionally remove knownFrontends 89/109489/1
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 30 Dec 2023 19:58:06 +0000 (20:58 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 30 Dec 2023 19:58:06 +0000 (20:58 +0100)
As noted in the comment, known frontends end up being restored from
metadata when we unpause (or become leader for that matter).

The DatastoreContext property being used in this conditional is a
frontend thing anyway, so the only thing it could really affect is
tests.

The only case where this would be needed is when we are the leader, have
started persisting the DisableTrackingPayload, but it has not propagated
during pause/unpause.

That is okay, as the leader handover ensures that all locally-appended
entries are appended, so that the new leader just continues on.

Change-Id: Icf775823aed91c15f7a8f74fa2f07faee3a084a0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java

index f8851901f964dd1c1ae87850d5e3c33a3bdff84a..ceff3e31f641a84c00b209f97433ab3f14eb1651 100644 (file)
@@ -1082,10 +1082,8 @@ public class Shard extends RaftActor {
         paused = true;
 
         // Tell-based protocol can replay transaction state, so it is safe to blow it up when we are paused.
-        if (datastoreContext.isUseTellBasedProtocol()) {
-            knownFrontends.values().forEach(LeaderFrontendState::retire);
-            knownFrontends = ImmutableMap.of();
-        }
+        knownFrontends.values().forEach(LeaderFrontendState::retire);
+        knownFrontends = ImmutableMap.of();
 
         store.setRunOnPendingTransactionsComplete(operation);
     }