jmsperu commented on code in PR #12847:
URL: https://github.com/apache/cloudstack/pull/12847#discussion_r3967702932
##########
api/src/main/java/org/apache/cloudstack/backup/BackupManager.java:
##########
@@ -59,6 +59,12 @@ public interface BackupManager extends BackupService,
Configurable, PluggableSer
"false",
"Enable volume attach/detach operations for VMs that are assigned
to Backup Offerings.", true);
+ ConfigKey<Boolean> NASBackupParallelExecution = new
ConfigKey<>("Advanced", Boolean.class,
+ "backup.nas.parallel.execution.enabled",
+ "true",
+ "Allow NAS take-backup commands to run in parallel with other
backup and delete commands on the KVM host. Disable to force sequential
execution.",
Review Comment:
Correct, and the description now says so: the command runs concurrently with
every other command on the host, which is what `executeInSequence=false` means,
bounded per host by the new cap. Restore and prepare-for-restore stay
sequential because they touch VM state.
##########
core/src/test/java/org/apache/cloudstack/backup/TakeBackupCommandTest.java:
##########
@@ -0,0 +1,41 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.backup;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TakeBackupCommandTest {
+
+ @Test
+ public void testExecuteInSequenceDefaultsToParallel() {
+ TakeBackupCommand command = new TakeBackupCommand("vm-1",
"/backups/vm-1");
+ // Default: run in parallel with other backup/delete commands.
+ Assert.assertFalse(command.executeInSequence());
+ }
+
+ @Test
+ public void testExecuteInSequenceIsSettable() {
Review Comment:
Added `NASBackupProviderTest`: it drives `applyExecutionPolicy()` with the
setting at true and at false and asserts the command's `executeInSequence()`
follows it, plus four tests on the per-host gate (the cap holds and releases,
hosts are independent, a waiter proceeds when a slot frees, release on an
unknown host is harmless). The setter test in core stays as the command-level
check.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]