Sergey Gotliv has posted comments on this change.

Change subject: engine: Speed up SPM re-selection process.
......................................................................


Patch Set 1: Verified+1

(4 comments)

....................................................
File 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/irsbroker/IrsBrokerCommand.java
Line 903:                             if (vdsToFenceObject.getStatus() == 
VDSStatus.NonResponsive) {
Line 904:                                 log.warn("SPM vds is non responsive, 
stopping spm selection.");
Line 905:                                 selectedVds.argvalue = null;
Line 906:                                 return spmStatus;
Line 907:                             } else if 
(stopSpm(vdsToFenceObject.getId())) {
Original method had around 200 rows, I needed to handle stopSPM properly, so I 
extracted this part to the method.
Line 908:                                 // if spm stop succeeded no need to 
fence, continue with spm selection
Line 909:                                 log.info("SPM stop succeeded, 
continue with SPM selection!");
Line 910:                             } else {
Line 911:                                 // if spm stop failed for any reason 
we stop spm selection


Line 929:                     log.infoFormat("starting spm on vds {0}, storage 
pool {1}, prevId {2}, LVER {3}",
Line 930:                             selectedVds.argvalue.getName(), 
storagePool.getName(), spmStatus.getSpmId(),
Line 931:                             spmStatus.getSpmLVER());
Line 932: 
Line 933:                     spmStatus = 
startSpm(selectedVds.argvalue.getId(), spmStatus, storagePool, vdsSpmIdToFence);
Again, very hard to read extremely long method, extracted this as is to 
startSPM method.
Line 934: 
Line 935:                     if (spmStatus != null && spmStatus.getSpmStatus() 
== SpmStatus.SPM) {
Line 936:                         _isSpmStartCalled = true;
Line 937:                     } else {


Line 936:                         _isSpmStartCalled = true;
Line 937:                     } else {
Line 938:                         
fireStoragePoolStatusChangedToNonResponsiveEvent(storagePool);
Line 939:                         if (spmStatus != null) {
Line 940:                             clearSpmVdsIdOnPool(storagePool);
Again, extraction.
Line 941:                         }
Line 942:                         throw new IrsSpmStartFailedException();
Line 943:                     }
Line 944:                 }


Line 951:                     VDSCommandType.SpmStop,
Line 952:                     new SpmStopVDSCommandParameters(vdsId, 
_storagePoolId)
Line 953:             );
Line 954:             return returnValue != null && (returnValue.getSucceeded() 
|| isNotSPM(returnValue));
Line 955:         }
"Not SPM" VDSM response should be treated as kind of success in case of stopSPM 
command.
Line 956: 
Line 957:         private boolean isNotSPM(VDSReturnValue returnValue) {
Line 958:             return returnValue != null && returnValue.getVdsError() 
!= null &&
Line 959:                     returnValue.getVdsError().getCode() == 
VdcBllErrors.SpmStatusError;


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I2c191ad8d4ec0fb4f5f8ff68b84fa5189ecc7114
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Sergey Gotliv <[email protected]>
Gerrit-Reviewer: Sergey Gotliv <[email protected]>
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to