Liron Aravot has uploaded a new change for review.

Change subject: core: ReconstructMasterDomain - refreshStoragePool before 
connectStoragePool(#841525)
......................................................................

core: ReconstructMasterDomain - refreshStoragePool before 
connectStoragePool(#841525)

https://bugzilla.redhat.com/841525

when performing reconstruct, a refresh storage pool command should be
sent before connect storage pool command on the hosts other than the one
who initiated the reconstruct command

Change-Id: I9b1b6c32ecb1c0d3c0a9ef14beef333e442c6ccf
Signed-off-by: Liron Aravot <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ReconstructMasterDomainCommand.java
1 file changed, 16 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/37/7137/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ReconstructMasterDomainCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ReconstructMasterDomainCommand.java
index 7b9188c..5ce766d 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ReconstructMasterDomainCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ReconstructMasterDomainCommand.java
@@ -217,11 +217,22 @@
         try {
             for (VDS vds : getAllRunningVdssInPool()) {
                 try {
-                    if (!_isLastMaster && commandSucceeded) {
-                        VDSReturnValue returnValue = 
executeConnectStoragePoolCommand(vds);
-                        if (returnValue.getSucceeded()) {
-                            executeRefreshStoragePoolCommand(vds);
-                        } else {
+                    VDSReturnValue returnValue = null;
+                    // refresh command shouldn't be executed for the 
reconstruct initiating host
+                    if (!_isLastMaster && commandSucceeded && 
!getVds().equals(vds)) {
+                        returnValue = executeRefreshStoragePoolCommand(vds);
+                        if (!returnValue.getSucceeded()) {
+                            log.errorFormat("Post reconstruct actions 
(refreshPool) did not complete on host {0} in the pool. error {1}",
+                                    vds.getId(),
+                                    returnValue.getVdsError().getMessage());
+                        }
+                    }
+                    // the host that executed the reconstruct command doesn't 
perform refresh
+                    // so even if refresh command wasn't executed in the loop 
(returnValue == null), we need to
+                    // connect to the storage pool.
+                    if (returnValue == null || returnValue.getSucceeded()) {
+                        returnValue = executeConnectStoragePoolCommand(vds);
+                        if (!returnValue.getSucceeded()) {
                             log.errorFormat("Post reconstruct actions 
(connectPool) did not complete on host {0} in the pool. error {1}",
                                     vds.getId(),
                                     returnValue.getVdsError().getMessage());


--
To view, visit http://gerrit.ovirt.org/7137
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9b1b6c32ecb1c0d3c0a9ef14beef333e442c6ccf
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Liron Aravot <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to