From: Robert Varga Date: Sat, 30 Dec 2023 19:58:06 +0000 (+0100) Subject: Unconditionally remove knownFrontends X-Git-Tag: v9.0.0~61 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=3d0b84870481f03e4187bfbb7da89ff23e37516b;p=controller.git Unconditionally remove knownFrontends 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 --- diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java index f8851901f9..ceff3e31f6 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java @@ -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); }