Cap shard-snapshot-chunk-size to 480KiB 28/100428/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 6 Apr 2022 06:07:51 +0000 (08:07 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 6 Apr 2022 06:08:49 +0000 (08:08 +0200)
We have a few places where we are using a default of 2MiB for chunk
size. Bring them down to 480KiB to match datastore.cfg.

JIRA: CONTROLLER-2037
Change-Id: I4dfc4cf3f41acd8c4b782e6450d17f5d5e8bf281
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/DefaultConfigParamsImpl.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DatastoreContext.java
opendaylight/md-sal/sal-distributed-datastore/src/main/yang/distributed-datastore-provider.yang

index 37ed729bed3e4edaf8f5f013c6a497edb8ba7eb6..0d65fa2ea1272a9ee77567cc493c7bd464b9ba27 100644 (file)
@@ -41,7 +41,7 @@ public class DefaultConfigParamsImpl implements ConfigParams {
      */
     private static final int ELECTION_TIME_MAX_VARIANCE = 100;
 
-    private static final int SNAPSHOT_CHUNK_SIZE = 2048 * 1000; //2MB
+    private static final int SNAPSHOT_CHUNK_SIZE = 480 * 1024; // 480KiB
 
 
     /**
@@ -95,9 +95,9 @@ public class DefaultConfigParamsImpl implements ConfigParams {
         this.snapshotBatchCount = snapshotBatchCount;
     }
 
-    public void setRecoverySnapshotIntervalSeconds(int recoverySnapshotInterval) {
+    public void setRecoverySnapshotIntervalSeconds(final int recoverySnapshotInterval) {
         checkArgument(recoverySnapshotInterval >= 0);
-        this.recoverySnapshotIntervalSeconds = recoverySnapshotInterval;
+        recoverySnapshotIntervalSeconds = recoverySnapshotInterval;
     }
 
     public void setSnapshotDataThresholdPercentage(final int snapshotDataThresholdPercentage) {
@@ -163,7 +163,7 @@ public class DefaultConfigParamsImpl implements ConfigParams {
 
     @Override
     public int getRecoverySnapshotIntervalSeconds() {
-        return this.recoverySnapshotIntervalSeconds;
+        return recoverySnapshotIntervalSeconds;
     }
 
     @Override
index 28fb89d2be3a9756523094f29d5904d6c6f82e3e..26a80d78f800c3a1b1bdaeb7058bd74abdd10c78 100644 (file)
@@ -65,7 +65,7 @@ public class DatastoreContext implements ClientActorConfig {
     public static final int DEFAULT_SHARD_BATCHED_MODIFICATION_COUNT = 1000;
     public static final long DEFAULT_SHARD_COMMIT_QUEUE_EXPIRY_TIMEOUT_IN_MS =
             TimeUnit.MILLISECONDS.convert(2, TimeUnit.MINUTES);
-    public static final int DEFAULT_MAX_MESSAGE_SLICE_SIZE = 2048 * 1000; // 2MB
+    public static final int DEFAULT_MAX_MESSAGE_SLICE_SIZE = 480 * 1024; // 480KiB
     public static final int DEFAULT_INITIAL_PAYLOAD_SERIALIZED_BUFFER_CAPACITY = 512;
     public static final ExportOnRecovery DEFAULT_EXPORT_ON_RECOVERY = ExportOnRecovery.Off;
     public static final String DEFAULT_RECOVERY_EXPORT_BASE_DIR = "persistence-export";
@@ -127,34 +127,34 @@ public class DatastoreContext implements ClientActorConfig {
     }
 
     private DatastoreContext(final DatastoreContext other) {
-        this.shardTransactionIdleTimeout = other.shardTransactionIdleTimeout;
-        this.operationTimeoutInMillis = other.operationTimeoutInMillis;
-        this.dataStoreMXBeanType = other.dataStoreMXBeanType;
-        this.shardTransactionCommitTimeoutInSeconds = other.shardTransactionCommitTimeoutInSeconds;
-        this.shardTransactionCommitQueueCapacity = other.shardTransactionCommitQueueCapacity;
-        this.shardInitializationTimeout = other.shardInitializationTimeout;
-        this.shardLeaderElectionTimeout = other.shardLeaderElectionTimeout;
-        this.initialSettleTimeoutMultiplier = other.initialSettleTimeoutMultiplier;
-        this.persistent = other.persistent;
-        this.snapshotOnRootOverwrite = other.snapshotOnRootOverwrite;
-        this.configurationReader = other.configurationReader;
-        this.transactionCreationInitialRateLimit = other.transactionCreationInitialRateLimit;
-        this.dataStoreName = other.dataStoreName;
-        this.logicalStoreType = other.logicalStoreType;
-        this.storeRoot = other.storeRoot;
-        this.shardBatchedModificationCount = other.shardBatchedModificationCount;
-        this.writeOnlyTransactionOptimizationsEnabled = other.writeOnlyTransactionOptimizationsEnabled;
-        this.shardCommitQueueExpiryTimeoutInMillis = other.shardCommitQueueExpiryTimeoutInMillis;
-        this.transactionDebugContextEnabled = other.transactionDebugContextEnabled;
-        this.shardManagerPersistenceId = other.shardManagerPersistenceId;
-        this.useTellBasedProtocol = other.useTellBasedProtocol;
-        this.backendAlivenessTimerInterval = other.backendAlivenessTimerInterval;
-        this.requestTimeout = other.requestTimeout;
-        this.noProgressTimeout = other.noProgressTimeout;
-        this.initialPayloadSerializedBufferCapacity = other.initialPayloadSerializedBufferCapacity;
-        this.useLz4Compression = other.useLz4Compression;
-        this.exportOnRecovery = other.exportOnRecovery;
-        this.recoveryExportBaseDir = other.recoveryExportBaseDir;
+        shardTransactionIdleTimeout = other.shardTransactionIdleTimeout;
+        operationTimeoutInMillis = other.operationTimeoutInMillis;
+        dataStoreMXBeanType = other.dataStoreMXBeanType;
+        shardTransactionCommitTimeoutInSeconds = other.shardTransactionCommitTimeoutInSeconds;
+        shardTransactionCommitQueueCapacity = other.shardTransactionCommitQueueCapacity;
+        shardInitializationTimeout = other.shardInitializationTimeout;
+        shardLeaderElectionTimeout = other.shardLeaderElectionTimeout;
+        initialSettleTimeoutMultiplier = other.initialSettleTimeoutMultiplier;
+        persistent = other.persistent;
+        snapshotOnRootOverwrite = other.snapshotOnRootOverwrite;
+        configurationReader = other.configurationReader;
+        transactionCreationInitialRateLimit = other.transactionCreationInitialRateLimit;
+        dataStoreName = other.dataStoreName;
+        logicalStoreType = other.logicalStoreType;
+        storeRoot = other.storeRoot;
+        shardBatchedModificationCount = other.shardBatchedModificationCount;
+        writeOnlyTransactionOptimizationsEnabled = other.writeOnlyTransactionOptimizationsEnabled;
+        shardCommitQueueExpiryTimeoutInMillis = other.shardCommitQueueExpiryTimeoutInMillis;
+        transactionDebugContextEnabled = other.transactionDebugContextEnabled;
+        shardManagerPersistenceId = other.shardManagerPersistenceId;
+        useTellBasedProtocol = other.useTellBasedProtocol;
+        backendAlivenessTimerInterval = other.backendAlivenessTimerInterval;
+        requestTimeout = other.requestTimeout;
+        noProgressTimeout = other.noProgressTimeout;
+        initialPayloadSerializedBufferCapacity = other.initialPayloadSerializedBufferCapacity;
+        useLz4Compression = other.useLz4Compression;
+        exportOnRecovery = other.exportOnRecovery;
+        recoveryExportBaseDir = other.recoveryExportBaseDir;
 
         setShardJournalRecoveryLogBatchSize(other.raftConfig.getJournalRecoveryLogBatchSize());
         setSnapshotBatchCount(other.raftConfig.getSnapshotBatchCount());
@@ -229,7 +229,7 @@ public class DatastoreContext implements ClientActorConfig {
     }
 
     public boolean isSnapshotOnRootOverwrite() {
-        return this.snapshotOnRootOverwrite;
+        return snapshotOnRootOverwrite;
     }
 
     public AkkaConfigurationReader getConfigurationReader() {
index 3ad7d532ad63c8c37e047cbc3b3a73bf16426a91..cdb534e3a446991c59ff79f9f5a2872aa8c22333 100644 (file)
@@ -211,14 +211,14 @@ module distributed-datastore-provider {
 
         leaf shard-snapshot-chunk-size {
             status deprecated;
-            default 2048000;
+            default 491520;
             type non-zero-uint32-type;
             description "When sending a snapshot to a follower, this is the maximum size in bytes for
                          a chunk of data.";
         }
 
         leaf maximum-message-slice-size {
-            default 2048000;
+            default 491520;
             type non-zero-uint32-type;
             description "When fragmenting messages thru the akka remoting framework, this is the
                          maximum size in bytes for a message slice.";