Skip to content

Commit 7dc3351

Browse files
Gupta, SuryaGupta, Surya
authored andcommitted
[CSTACKEX-204] Resolved Review Comments
1 parent e38939c commit 7dc3351

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

engine/schema/src/main/java/com/cloud/storage/dao/VolumeDaoImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ public class VolumeDaoImpl extends GenericDaoBase<VolumeVO, Long> implements Vol
9696
protected static final String SELECT_HYPERTYPE_FROM_CLUSTER_VOLUME = "SELECT c.hypervisor_type from volumes v, storage_pool s, cluster c where v.pool_id = s.id and s.cluster_id = c.id and v.id = ?";
9797
protected static final String SELECT_HYPERTYPE_FROM_ZONE_VOLUME = "SELECT s.hypervisor from volumes v, storage_pool s where v.pool_id = s.id and v.id = ?";
9898
protected static final String SELECT_POOLSCOPE = "SELECT s.scope from storage_pool s, volumes v where s.id = v.pool_id and v.id = ?";
99+
// Looks for a VM whose root disk is on this pool and whose data disk is on another pool.
100+
// LIMIT 1 stops after the first match so we do not load all volumes.
99101
private static final String HAS_MULTI_PRIMARY_STORAGE_POOL_VM =
100102
"SELECT 1 FROM volumes root INNER JOIN volumes data ON data.instance_id = root.instance_id "
101103
+ "WHERE root.pool_id = ? AND root.volume_type = 'ROOT' AND root.instance_id IS NOT NULL "

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/asup/OntapAsupManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public class OntapAsupManager extends ManagerBase {
8484
private static final int ASUP_LOCK_TIMEOUT_SECONDS = 5;
8585

8686
/**
87-
* Fixed wakeup interval (ms) for {@link OntapAsupPollTask} (2 hours). The task wakes on
87+
* Fixed wakeup interval (ms) for {@link OntapAsupPollTask} (1 hour). The task wakes on
8888
* this cadence and checks whether the live configured push interval
8989
* ({@link OntapConfigurationManager#AsupIntervalSeconds}) has elapsed. UI edits of that
9090
* interval are applied immediately via the configuration-edit event; this delay is only

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/utils/OntapStorageConstants.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public class OntapStorageConstants {
171171
public static final String ASUP_ENABLED_CONFIG_KEY = "ontap.asup.enabled";
172172
public static final String ASUP_ENABLED_DEFAULT = "true";
173173
public static final String ASUP_INTERVAL_CONFIG_KEY = "ontap.asup.interval";
174-
public static final int ASUP_MIN_INTERVAL_SECONDS = 60; // 1 minute (demo; production is 10800)
174+
public static final int ASUP_MIN_INTERVAL_SECONDS = 10800; // 3 hours
175175
public static final int ASUP_MAX_INTERVAL_SECONDS = 86400; // 24 hours
176176
public static final int ASUP_DEFAULT_INTERVAL_SECONDS = 43200; // 12 hours (twice a day)
177177

@@ -181,7 +181,7 @@ public class OntapStorageConstants {
181181
* window. Config edits are applied immediately via the configuration-edit event; this
182182
* delay is only the background check, not the ASUP push interval.
183183
*/
184-
public static final int ASUP_POLL_CHECK_INTERVAL_SECONDS = 10; // 10 seconds (demo; production is 7200)
184+
public static final int ASUP_POLL_CHECK_INTERVAL_SECONDS = 3600; // 1 hour
185185

186186
public static final String ASUP_ENABLED_DESCRIPTION =
187187
"Set to true to enable telemetry reporting from the CloudStack ONTAP plugin, or false to disable it. "

plugins/storage/volume/ontap/src/test/java/org/apache/cloudstack/storage/asup/OntapAsupManagerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ void validateAsupInterval_acceptsMinMaxAndDefault() {
500500

501501
@Test
502502
void validateAsupInterval_rejectsOutOfRangeAndNonInteger() {
503-
assertThrows(InvalidParameterValueException.class, () -> OntapConfigurationManager.AsupIntervalSeconds.validateValue("59"));
503+
assertThrows(InvalidParameterValueException.class, () -> OntapConfigurationManager.AsupIntervalSeconds.validateValue("10799"));
504504
assertThrows(InvalidParameterValueException.class, () -> OntapConfigurationManager.AsupIntervalSeconds.validateValue("86401"));
505505
assertThrows(InvalidParameterValueException.class, () -> OntapConfigurationManager.AsupIntervalSeconds.validateValue("0"));
506506
assertThrows(InvalidParameterValueException.class, () -> OntapConfigurationManager.AsupIntervalSeconds.validateValue("abc"));
@@ -514,7 +514,7 @@ void getAsupIntervalSeconds_fallsBackOutsideRange() {
514514
assertEquals(OntapStorageConstants.ASUP_DEFAULT_INTERVAL_SECONDS,
515515
asupManager.getAsupIntervalSeconds(0));
516516
assertEquals(OntapStorageConstants.ASUP_DEFAULT_INTERVAL_SECONDS,
517-
asupManager.getAsupIntervalSeconds(59));
517+
asupManager.getAsupIntervalSeconds(10799));
518518
assertEquals(OntapStorageConstants.ASUP_DEFAULT_INTERVAL_SECONDS,
519519
asupManager.getAsupIntervalSeconds(86401));
520520
assertEquals(OntapStorageConstants.ASUP_MIN_INTERVAL_SECONDS,

0 commit comments

Comments
 (0)