Michael Kublin has posted comments on this change.
Change subject: core: Run upgradeStoragePool on cluster compatibility change
......................................................................
Patch Set 16: I would prefer that you didn't submit this
(10 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/UpdateStoragePoolCommand.java
Line 31:
Infra: mark a command as nontransactive - in order to disable a global
transaction.
You are performing two vdsm calls the time for transaction is too long.
Line 52: updateDefaultQuota();
Perform update only at case of vdsm call successes, also use only one time
updatePartia() .
Also change updatePartial() , can also update storage pool format type
Line 54: if (getStoragePool().getstatus() == StoragePoolStatus.Up) {
These check is bug, it is strange that the flow is working till now.
getStoragePool() it is pool which was passed by gui or rest, should be used
_oldStoragePool
Line 113: StorageType spType = storagePool.getstorage_pool_type();
I think these check is good candidate for canDoaction error message
Line 121: getStoragePoolDAO().update(storagePool);
use updatePartitial(), also it is wrong to use update(), like I said these is
not a full object and it passed from gui
Line 130: // as VDSM will silently ignore the request
Don't need a varible and at any case should be inside if block
Line 145:
Log should be written only when update is perfomed
Line 152: }
These is more code stile, but I think it is easy to understand:
if (sdType == StorageDomainType.Data || sdType == StorageDomainType.Master) {
log.infoFormat("Updating storage domain {0} (type {1}) to format {2}",
domain.getId(), sdType, targetFormat);
domain.setStorageFormat(targetFormat);
sdStatDao.update(domain);
}
Line 164: @Override
There are no any new error message at canDoAction() for illegal storage format
type, at case that someone will try to upgrade at 2.2/3.0 pool we should fail
action
Line 167: _oldStoragePool =
getStoragePoolDAO().get(getStoragePool().getId());
also bug , not related to your patch, but if you already here :
checkStoragePool() is not needed, and we should check that _oldStoragePool is
not null
--
To view, visit http://gerrit.ovirt.org/2441
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I85201624bbb2f8c41cf3b184b89a8e199ff50e99
Gerrit-PatchSet: 16
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <[email protected]>
Gerrit-Reviewer: Ayal Baron <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Laszlo Hornyak <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Michael Kublin <[email protected]>
Gerrit-Reviewer: Mike Kolesnik <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Saggi Mizrahi <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches