Obsolete ask-based protocol 03/103103/11
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 5 Nov 2022 02:11:54 +0000 (03:11 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 3 Dec 2022 12:47:34 +0000 (13:47 +0100)
Mark the switch to use ask-based protocol obsolete and deprecate all
classes implementing it.

JIRA: CONTROLLER-2053
Change-Id: Ib0f5d6a946090addde255423d51746a52e785b2a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-clustering-config/src/main/resources/initial/datastore.cfg
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DatastoreContext.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DistributedDataStore.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreFactory.java
opendaylight/md-sal/sal-distributed-datastore/src/main/yang/distributed-datastore-provider.yang
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/ConcurrentDOMDataBrokerTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/IntegrationTestKit.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/TestDistributedDataStore.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/shardmanager/ShardManagerTest.java

index 678903c74c4e37a4e0ea5ade80c305017a7f6512..272d03a19696625fc8d3518555feed2ff01a1458 100644 (file)
@@ -92,6 +92,7 @@ maximum-message-slice-size=491520
 # Enable tell-based protocol between frontend (applications) and backend (shards). Using this protocol
 # should avoid AskTimeoutExceptions seen under heavy load. Defaults to false (use tell-based protocol).
 # Set to false to enable ask-based protocol.
+# This option is obsolete and will be removed in the next major release.
 use-tell-based-protocol=true
 
 # Tune the maximum number of entries a follower is allowed to lag behind the leader before it is
index 17e0a5c094f181e6115083a0085e8c33cf81301c..f9e6cc9ae606db79c3438a04d9c61b47e4689b88 100644 (file)
@@ -96,6 +96,7 @@ public class DatastoreContext implements ClientActorConfig {
     private int shardBatchedModificationCount = DEFAULT_SHARD_BATCHED_MODIFICATION_COUNT;
     private boolean writeOnlyTransactionOptimizationsEnabled = true;
     private long shardCommitQueueExpiryTimeoutInMillis = DEFAULT_SHARD_COMMIT_QUEUE_EXPIRY_TIMEOUT_IN_MS;
+    @Deprecated(since = "7.0.0", forRemoval = true)
     private boolean useTellBasedProtocol = true;
     private boolean transactionDebugContextEnabled = false;
     private String shardManagerPersistenceId;
@@ -365,6 +366,7 @@ public class DatastoreContext implements ClientActorConfig {
         return transactionDebugContextEnabled;
     }
 
+    @Deprecated(since = "7.0.0", forRemoval = true)
     public boolean isUseTellBasedProtocol() {
         return useTellBasedProtocol;
     }
@@ -602,6 +604,7 @@ public class DatastoreContext implements ClientActorConfig {
             return this;
         }
 
+        @Deprecated(since = "7.0.0", forRemoval = true)
         public Builder useTellBasedProtocol(final boolean value) {
             datastoreContext.useTellBasedProtocol = value;
             return this;
index 16198ff544f35ef995e510dee189c0af2ce25f5e..5572d577cc40776150694474b4c2deeb55df0842 100644 (file)
@@ -20,23 +20,25 @@ import org.opendaylight.mdsal.dom.spi.store.DOMStoreTransactionChain;
 import org.opendaylight.mdsal.dom.spi.store.DOMStoreWriteTransaction;
 
 /**
- * Implements a distributed DOMStore using Akka Patterns.ask().
+ * Implements a distributed DOMStore using Akka {@code Patterns.ask()}.
+ *
+ * @deprecated This implementation is destined for removal,
  */
+@Deprecated(since = "7.0.0", forRemoval = true)
 public class DistributedDataStore extends AbstractDataStore {
-
     private final TransactionContextFactory txContextFactory;
 
     public DistributedDataStore(final ActorSystem actorSystem, final ClusterWrapper cluster,
             final Configuration configuration, final DatastoreContextFactory datastoreContextFactory,
             final DatastoreSnapshot restoreFromSnapshot) {
         super(actorSystem, cluster, configuration, datastoreContextFactory, restoreFromSnapshot);
-        this.txContextFactory = new TransactionContextFactory(getActorUtils(), getIdentifier());
+        txContextFactory = new TransactionContextFactory(getActorUtils(), getIdentifier());
     }
 
     @VisibleForTesting
     DistributedDataStore(final ActorUtils actorUtils, final ClientIdentifier identifier) {
         super(actorUtils, identifier);
-        this.txContextFactory = new TransactionContextFactory(getActorUtils(), getIdentifier());
+        txContextFactory = new TransactionContextFactory(getActorUtils(), getIdentifier());
     }
 
 
index 221db2faea0ff6157db7f609f9af9179aecfec6b..8a50417f67f610df83594fb60dad192000686a17 100644 (file)
@@ -83,7 +83,8 @@ public final class DistributedDataStoreFactory {
         } else {
             dataStore = new DistributedDataStore(actorSystem, clusterWrapper, config, contextFactory,
                 restoreFromSnapshot);
-            LOG.info("Data store {} is using ask-based protocol", datastoreName);
+            LOG.warn("Data store {} is using ask-based protocol, which will be removed in the next major release",
+                datastoreName);
         }
 
         return dataStore;
index cdb534e3a446991c59ff79f9f5a2872aa8c22333..eb8173ec8aca9802c1730b0147179dea49c7bb18 100644 (file)
@@ -225,6 +225,7 @@ module distributed-datastore-provider {
         }
 
         leaf use-tell-based-protocol {
+            status obsolete;
             default false;
             type boolean;
             description "Use a newer protocol between the frontend and backend. This feature is considered
index 346578f949df5edc9a6f41eeb56ee24d17bc20da..bcaef6bef401c5bbf0b5af448ae051e36df5d674 100644 (file)
@@ -47,7 +47,7 @@ import org.junit.Before;
 import org.junit.Test;
 import org.mockito.InOrder;
 import org.mockito.stubbing.Answer;
-import org.opendaylight.controller.cluster.datastore.DistributedDataStore;
+import org.opendaylight.controller.cluster.datastore.AbstractDataStore;
 import org.opendaylight.mdsal.common.api.CommitInfo;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
@@ -431,8 +431,8 @@ public class ConcurrentDOMDataBrokerTest {
 
     @Test
     public void testExtensions() {
-        DistributedDataStore mockConfigStore = mock(DistributedDataStore.class);
-        DistributedDataStore mockOperStore = mock(DistributedDataStore.class);
+        final var mockConfigStore = mock(AbstractDataStore.class);
+        final var mockOperStore = mock(AbstractDataStore.class);
         try (ConcurrentDOMDataBroker dataBroker = new ConcurrentDOMDataBroker(ImmutableMap.of(
                 LogicalDatastoreType.OPERATIONAL, mockOperStore,
                 LogicalDatastoreType.CONFIGURATION, mockConfigStore), futureExecutor)) {
index 72cfdceeeaff415dd86d189bef84dae0b33ed207..8bb274e2e4760b9eae1d12b3f8bad5f2a3d283c6 100644 (file)
@@ -77,12 +77,14 @@ public class IntegrationTestKit extends ShardTestKit {
         return datastoreContextBuilder;
     }
 
+    @Deprecated(since = "7.0.0", forRemoval = true)
     public DistributedDataStore setupDistributedDataStore(final String typeName, final String moduleShardsConfig,
                                                           final boolean waitUntilLeader,
                                                           final EffectiveModelContext schemaContext) throws Exception {
         return setupDistributedDataStore(typeName, moduleShardsConfig, "modules.conf", waitUntilLeader, schemaContext);
     }
 
+    @Deprecated(since = "7.0.0", forRemoval = true)
     public DistributedDataStore setupDistributedDataStore(final String typeName, final String moduleShardsConfig,
                                                           final String modulesConfig,
                                                           final boolean waitUntilLeader,
@@ -169,6 +171,7 @@ public class IntegrationTestKit extends ShardTestKit {
         }
     }
 
+    @Deprecated(since = "7.0.0", forRemoval = true)
     public DistributedDataStore setupDistributedDataStoreWithoutConfig(final String typeName,
                                                                        final EffectiveModelContext schemaContext) {
         final ClusterWrapper cluster = new ClusterWrapperImpl(getSystem());
@@ -191,6 +194,7 @@ public class IntegrationTestKit extends ShardTestKit {
         return dataStore;
     }
 
+    @Deprecated(since = "7.0.0", forRemoval = true)
     public DistributedDataStore setupDistributedDataStoreWithoutConfig(final String typeName,
                                                                        final EffectiveModelContext schemaContext,
                                                                        final LogicalDatastoreType storeType) {
index 882d0e176b4efb822858fd0e3a679af90be2a32f..638b3960c111ca163f788456436820d379961043 100644 (file)
@@ -15,6 +15,7 @@ import org.opendaylight.controller.cluster.datastore.shardmanager.AbstractShardM
 import org.opendaylight.controller.cluster.datastore.shardmanager.TestShardManager;
 import org.opendaylight.controller.cluster.datastore.utils.ActorUtils;
 
+@Deprecated(since = "7.0.0", forRemoval = true)
 public class TestDistributedDataStore extends DistributedDataStore implements LocalShardStore {
 
     public TestDistributedDataStore(final ActorSystem actorSystem, final ClusterWrapper cluster,
index c7dc25fc866fdde3ba81aa5f37335b635bb25c88..9d31d2154442a4c51835fa6926a8dc55a2ed0fc4 100644 (file)
@@ -74,11 +74,11 @@ import org.junit.runner.RunWith;
 import org.mockito.junit.MockitoJUnitRunner;
 import org.opendaylight.controller.cluster.access.concepts.MemberName;
 import org.opendaylight.controller.cluster.datastore.AbstractClusterRefActorTest;
+import org.opendaylight.controller.cluster.datastore.AbstractDataStore;
 import org.opendaylight.controller.cluster.datastore.ClusterWrapperImpl;
 import org.opendaylight.controller.cluster.datastore.DataStoreVersions;
 import org.opendaylight.controller.cluster.datastore.DatastoreContext;
 import org.opendaylight.controller.cluster.datastore.DatastoreContextFactory;
-import org.opendaylight.controller.cluster.datastore.DistributedDataStore;
 import org.opendaylight.controller.cluster.datastore.Shard;
 import org.opendaylight.controller.cluster.datastore.config.Configuration;
 import org.opendaylight.controller.cluster.datastore.config.ConfigurationImpl;
@@ -203,12 +203,12 @@ public class ShardManagerTest extends AbstractClusterRefActorTest {
     }
 
     private TestShardManager.Builder newTestShardMgrBuilder() {
-        return TestShardManager.builder(datastoreContextBuilder).distributedDataStore(mock(DistributedDataStore.class));
+        return TestShardManager.builder(datastoreContextBuilder).distributedDataStore(mock(AbstractDataStore.class));
     }
 
     private TestShardManager.Builder newTestShardMgrBuilder(final Configuration config) {
         return TestShardManager.builder(datastoreContextBuilder).configuration(config)
-                .distributedDataStore(mock(DistributedDataStore.class));
+                .distributedDataStore(mock(AbstractDataStore.class));
     }
 
     private Props newShardMgrProps() {
@@ -245,7 +245,7 @@ public class ShardManagerTest extends AbstractClusterRefActorTest {
 
     private TestShardManager.Builder newTestShardMgrBuilderWithMockShardActor(final ActorRef shardActor) {
         return TestShardManager.builder(datastoreContextBuilder).shardActor(shardActor)
-                .distributedDataStore(mock(DistributedDataStore.class));
+                .distributedDataStore(mock(AbstractDataStore.class));
     }