Allon Mureinik has posted comments on this change.

Change subject: engine: Remove IsValidVDSCommand (Preporation for removing 
global lock on SPM ops)
......................................................................


Patch Set 1: (7 inline comments)

some general notes:
1. You have the "getStoragePool() == null || getStoragePool().getstatus() != 
StoragePoolStatus.Up" block repeating itself quite often. Perhaps it's worth 
while extracting it to a helper method somewhere.

2. In several places you just removed this verification. Are you sure it is not 
needed (e.g., is it done in some previous location?)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmCommand.java
Line 84:         try {
Line 85:             updateVmInSpm(getVm().getstorage_pool_id(),
Line 86:                     Arrays.asList(getVm()));
Line 87:         } catch (Exception e) {
Line 88:             // DO nothing
Consider logging the exception
Line 89:         }
Line 90:         setSucceeded(true);
Line 91:     }
Line 92: 


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmHandler.java
Line 108:             if (reasons != null) {
Line 109:                 
reasons.add(VdcBllMessages.MAC_POOL_NOT_ENOUGH_MAC_ADDRESSES.toString());
Line 110:             }
Line 111:             returnValue = false;
Line 112:         } else if 
(!VmTemplateCommand.IsVmPriorityValueLegal(vmPriority, reasons)) {
IsVmPriorityValueLegal should probably not be a part of VmTemplateCommand, but 
I wouldn't handle it in this patch.
Line 113:             returnValue = false;
Line 114:         }
Line 115:         return returnValue;
Line 116:     }


....................................................
File 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/irsbroker/IrsBrokerCommand.java
Line 498:             setmIrsPort(vds.getport());
Line 499:             setmCurrentIrsHost(vds.gethost_name());
Line 500:         }
Line 501: 
Line 502:         public boolean failover() {
why is this cleanup relevant for this patch?
Line 503:             setmIrsProxy(null);
Line 504:             setmCurrentIrsHost(null);
Line 505:             boolean performFailover = false;
Line 506:             if (mCurrentVdsId != null) {


Line 517:                                         new 
SpmStopVDSCommandParameters(mCurrentVdsId, _storagePoolId)).getSucceeded();
Line 518:                     } else {
Line 519:                         performFailover = true;
Line 520:                     }
Line 521:                 } catch (Exception ex) {
why is this cleanup relevant for this patch?
Line 522:                     // try to failover to another host if failed to 
get spm
Line 523:                     // status or stop spm
Line 524:                     // (in case mCurrentVdsId has wrong id for some 
reason)
Line 525:                     log.errorFormat("Could not get spm status on host 
{0} for spmStop.", mCurrentVdsId);


....................................................
Commit Message
Line 8: 
Line 9: The following patch will remove IsValidVDSCommand.
Line 10: The following command was used in order to check if pool is up and we 
have spm.
Line 11: First of all the using of command at canDoaction is wrong, a simple 
check for status of pool or status
Line 12: of domain should be enought.
typo: s/enought/enough/
Line 13: But the most exciting part is that the following command can trigger 
SPM election and it is done with out
Line 14: any synchronization, so we can easilly have couple spm elections 
simenteniously.
Line 15: The code at IsValidVDSCommand was 
getCurrentIrsProxyData().getIsValid(), which is actually code at IrsProxyData:
Line 16: getIrsProxy() != null, where getIrsProxy() is elect SPM if we have not 
one.


Line 9: The following patch will remove IsValidVDSCommand.
Line 10: The following command was used in order to check if pool is up and we 
have spm.
Line 11: First of all the using of command at canDoaction is wrong, a simple 
check for status of pool or status
Line 12: of domain should be enought.
Line 13: But the most exciting part is that the following command can trigger 
SPM election and it is done with out
typo: s/with out/without/
Line 14: any synchronization, so we can easilly have couple spm elections 
simenteniously.
Line 15: The code at IsValidVDSCommand was 
getCurrentIrsProxyData().getIsValid(), which is actually code at IrsProxyData:
Line 16: getIrsProxy() != null, where getIrsProxy() is elect SPM if we have not 
one.
Line 17: 


Line 10: The following command was used in order to check if pool is up and we 
have spm.
Line 11: First of all the using of command at canDoaction is wrong, a simple 
check for status of pool or status
Line 12: of domain should be enought.
Line 13: But the most exciting part is that the following command can trigger 
SPM election and it is done with out
Line 14: any synchronization, so we can easilly have couple spm elections 
simenteniously.
s/couple/a couple/
Line 15: The code at IsValidVDSCommand was 
getCurrentIrsProxyData().getIsValid(), which is actually code at IrsProxyData:
Line 16: getIrsProxy() != null, where getIrsProxy() is elect SPM if we have not 
one.
Line 17: 
Line 18: Change-Id: I73c0fa0fd66f2f14132594a0b0450a7ecd7cf166


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I73c0fa0fd66f2f14132594a0b0450a7ecd7cf166
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Michael Kublin <mkub...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Ayal Baron <aba...@redhat.com>
Gerrit-Reviewer: Eli Mesika <emes...@redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com>
Gerrit-Reviewer: Michael Kublin <mkub...@redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to