Allon Mureinik has posted comments on this change.

Change subject: core: Limitation addition for downgrading DC's compatible 
version.
......................................................................


Patch Set 8: Code-Review-1

(10 comments)

http://gerrit.ovirt.org/#/c/35790/8/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/UpdateStoragePoolCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/UpdateStoragePoolCommand.java:

Line 213:         StoragePoolValidator validator = createStoragePoolValidator();
Line 214:         return validate(validator.isNotLocalfsWithDefaultCluster());
Line 215:     }
Line 216: 
Line 217:     private boolean 
isDowngradeEnabledByDomains(List<StorageDomainStatic> poolDomains) {
how about "isDowngradeAllowedForDomains" ?
Line 218:         List<String> formatProblematicDomains = new ArrayList<>();
Line 219:         List<String> typeProblematicDomains = new ArrayList<>();
Line 220:         boolean isMixedSupportFailing = false;
Line 221: 


Line 216: 
Line 217:     private boolean 
isDowngradeEnabledByDomains(List<StorageDomainStatic> poolDomains) {
Line 218:         List<String> formatProblematicDomains = new ArrayList<>();
Line 219:         List<String> typeProblematicDomains = new ArrayList<>();
Line 220:         boolean isMixedSupportFailing = false;
Default should be true - until you find a domain that fails this check
Line 221: 
Line 222:         for (StorageDomainStatic domainStatic : poolDomains) {
Line 223:             StorageDomain domain = new StorageDomain();
Line 224:             domain.setStorageStaticData(domainStatic);


Line 225: 
Line 226:             StorageDomainToPoolRelationValidator 
attachDomainValidator = getAttachDomainValidator(domain);
Line 227: 
Line 228:             if 
(!attachDomainValidator.isStorageDomainTypeFitsPoolIfMixed().isValid()) {
Line 229:                 isMixedSupportFailing = true;
Don't you want to remember this name somewhere?
Line 230:             }
Line 231:             if 
(!attachDomainValidator.isStorageDomainTypeSupportedInPool().isValid()) {
Line 232:                 typeProblematicDomains.add(domain.getName());
Line 233:             }


Line 235:                 formatProblematicDomains.add(domain.getName());
Line 236:             }
Line 237:         }
Line 238: 
Line 239:         int numberOfProblematicDomainsToShow = 10;
Isn't this the default of ReplacementUtils?
Line 240:         if (isMixedSupportFailing) {
Line 241:             
addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_MIXED_STORAGE_TYPES_NOT_ALLOWED);
Line 242:         }
Line 243:         if (!formatProblematicDomains.isEmpty()) {


http://gerrit.ovirt.org/#/c/35790/8/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/UpdateStoragePoolCommandTest.java
File 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/UpdateStoragePoolCommandTest.java:

Line 443:             return DbFacade.getInstance().getVdsGroupDao();
Line 444:         }
Line 445:     }
Line 446: 
Line 447:     protected class AttachDomainValidatorForTesting extends 
StorageDomainToPoolRelationValidator {
Why isn't spying enough here?
Line 448:         public AttachDomainValidatorForTesting(StorageDomain domain, 
StoragePool pool) {
Line 449:             super(domain, pool);
Line 450:         }
Line 451: 


Line 449:             super(domain, pool);
Line 450:         }
Line 451: 
Line 452:         public StoragePoolDAO getStoragePoolDao() {
Line 453:             return DbFacade.getInstance().getStoragePoolDao();
?!
Line 454:         }
Line 455:     }


http://gerrit.ovirt.org/#/c/35790/8/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
File 
backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties:

Line 675: ACTION_TYPE_FAILED_ILLEGAL_DOMAIN_NAME=Cannot ${action} ${type}. 
Illegal Domain name: ${Domain}. Domain name has unsupported special character 
${Char}.
Line 676: ACTION_TYPE_FAILED_ILLEGAL_ARCHITECTURE_TYPE_INCOMPATIBLE=Cannot 
${action} ${type}. Architecture does not match the expected value.
Line 677: ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION=Cannot 
decrease data center compatibility version.
Line 678: 
ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION_UNDER_DC=Cannot 
decrease cluster compatibility version beneath data center compatibility 
version.
Line 679: 
ACTION_TYPE_FAILED_DECREASING_COMPATIBILITY_VERSION_CAUSES_STORAGE_FORMAT_DOWNGRADING=Cannot
 ${action} ${type}. this action will cause storage format downgrading which is 
not supported. The following storage domains cannot be downgraded: 
${formatDowngradedDomains}.
s/this/This/
Line 680: 
ACTION_TYPE_FAILED_STORAGE_DOMAINS_ARE_NOT_SUPPORTET_IN_DOWNGRADED_VERSION=Cannot
 ${action} ${type}. The following storage domains are not supported in the 
selected version: ${unsupportedVersionDomains}.
Line 681: ACTION_TYPE_FAILED_GIVEN_VERSION_NOT_SUPPORTED=Cannot ${action} 
${type}. Selected Compatibility Version is not supported.
Line 682: 
ACTION_TYPE_FAILED_DATA_CENTER_VERSION_DOESNT_SUPPORT_LIVE_SNAPSHOT=Cannot 
${action} ${type}. Selected data center compatibility version does not support 
live snapshot.
Line 683: NETWORK_ADDR_MANDATORY_IN_STATIC_IP=Network address must be specified 
when using static IP


http://gerrit.ovirt.org/#/c/35790/8/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
File 
frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java:

Line 1848: 
Line 1849:     @DefaultStringValue("Cannot decrease data center compatibility 
version.")
Line 1850:     String 
ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION();
Line 1851: 
Line 1852:     @DefaultStringValue("Cannot ${action} ${type}. this action will 
cause storage format downgrading which is not supported. The following storage 
domains cannot be downgraded: ${formatDowngradedDomains}.")
s/this/This/
Line 1853:     String 
ACTION_TYPE_FAILED_DECREASING_COMPATIBILITY_VERSION_CAUSES_STORAGE_FORMAT_DOWNGRADING();
Line 1854: 
Line 1855:     @DefaultStringValue("Cannot ${action} ${type}. The following 
storage domains are not supported in the selected version: 
${unsupportedVersionDomains}.")
Line 1856:     String 
ACTION_TYPE_FAILED_STORAGE_DOMAINS_ARE_NOT_SUPPORTET_IN_DOWNGRADED_VERSION();


http://gerrit.ovirt.org/#/c/35790/8/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
File 
frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties:

Line 629: ACTION_TYPE_FAILED_ILLEGAL_DOMAIN_NAME=Cannot ${action} ${type}. 
Illegal Domain name: ${Domain}. Domain name has unsupported special character 
${Char}.
Line 630: ACTION_TYPE_FAILED_ILLEGAL_ARCHITECTURE_TYPE_INCOMPATIBLE=Cannot 
${action} ${type}. Architecture does not match the expected value.
Line 631: ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION=Cannot 
decrease data center compatibility version.
Line 632: 
ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION_UNDER_DC=Cannot 
decrease cluster compatibility version beneath data center compatibility 
version.
Line 633: 
ACTION_TYPE_FAILED_DECREASING_COMPATIBILITY_VERSION_CAUSES_STORAGE_FORMAT_DOWNGRADING=Cannot
 ${action} ${type}. this action will cause storage format downgrading which is 
not supported. The following storage domains cannot be downgraded: 
${formatDowngradedDomains}.
s/this/This/
Line 634: 
ACTION_TYPE_FAILED_STORAGE_DOMAINS_ARE_NOT_SUPPORTET_IN_DOWNGRADED_VERSION=Cannot
 ${action} ${type}. The following storage domains are not supported in the 
selected version: ${unsupportedVersionDomains}.
Line 635: ACTION_TYPE_FAILED_GIVEN_VERSION_NOT_SUPPORTED=Cannot ${action} 
${type}. Selected Compatibility Version is not supported.
Line 636: 
ACTION_TYPE_FAILED_DATA_CENTER_VERSION_DOESNT_SUPPORT_LIVE_SNAPSHOT=Cannot 
${action} ${type}. Selected data center compatibility version does not support 
live snapshot.
Line 637: NETWORK_ADDR_MANDATORY_IN_STATIC_IP=Network address must be specified 
when using static ip


http://gerrit.ovirt.org/#/c/35790/8/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
File 
frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties:

Line 675: ACTION_TYPE_FAILED_ILLEGAL_DOMAIN_NAME=Cannot ${action} ${type}. 
Illegal Domain name: ${Domain}. Domain name has unsupported special character 
${Char}.
Line 676: ACTION_TYPE_FAILED_ILLEGAL_ARCHITECTURE_TYPE_INCOMPATIBLE=Cannot 
${action} ${type}. Architecture does not match the expected value.
Line 677: ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION=Cannot 
decrease data center compatibility version.
Line 678: 
ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION_UNDER_DC=Cannot 
decrease cluster compatibility version beneath data center compatibility 
version.
Line 679: 
ACTION_TYPE_FAILED_DECREASING_COMPATIBILITY_VERSION_CAUSES_STORAGE_FORMAT_DOWNGRADING=Cannot
 ${action} ${type}. this action will cause storage format downgrading which is 
not supported. The following storage domains cannot be downgraded: 
${formatDowngradedDomains}.
s/this/This/
Line 680: 
ACTION_TYPE_FAILED_STORAGE_DOMAINS_ARE_NOT_SUPPORTET_IN_DOWNGRADED_VERSION=Cannot
 ${action} ${type}. The following storage domains are not supported in the 
selected version: ${unsupportedVersionDomains}.
Line 681: ACTION_TYPE_FAILED_GIVEN_VERSION_NOT_SUPPORTED=Cannot ${action} 
${type}. Selected Compatibility Version is not supported.
Line 682: 
ACTION_TYPE_FAILED_DATA_CENTER_VERSION_DOESNT_SUPPORT_LIVE_SNAPSHOT=Cannot 
${action} ${type}. Selected data center compatibility version does not support 
live snapshot.
Line 683: NETWORK_ADDR_MANDATORY_IN_STATIC_IP=Network address must be specified 
when using static ip


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib97488c705a32fe73b390ef226b1ad19a3784b76
Gerrit-PatchSet: 8
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Amit Aviram <aavi...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Amit Aviram <aavi...@redhat.com>
Gerrit-Reviewer: Daniel Erez <de...@redhat.com>
Gerrit-Reviewer: Liron Aravot <lara...@redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com>
Gerrit-Reviewer: Tal Nisan <tni...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to