Federico Simoncelli has posted comments on this change. Change subject: core: prevent maintenance when domain is sill in use ......................................................................
Patch Set 5: (8 comments) http://gerrit.ovirt.org/#/c/22045/5//COMMIT_MSG Commit Message: Line 3: AuthorDate: 2013-12-04 17:43:13 +0100 Line 4: Commit: Federico Simoncelli <[email protected]> Line 5: CommitDate: 2014-01-13 09:25:31 +0100 Line 6: Line 7: core: prevent maintenance when domain is sill in use > s/sill/still Done Line 8: Line 9: Change-Id: I55cd5aa6a6dc32f374a4bb21b159d3cb30da65f5 http://gerrit.ovirt.org/#/c/22045/5/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/DeactivateStorageDomainCommand.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/DeactivateStorageDomainCommand.java: Line 108: return failCanDoAction(VdcBllMessages.ERROR_CANNOT_DEACTIVATE_MASTER_WITH_NON_DATA_DOMAINS); Line 109: } Line 110: Line 111: if (!filterDomainsByStatus(domains, StorageDomainStatus.Locked).isEmpty() Line 112: || !filterDomainsByStatus(domains, StorageDomainStatus.MovingToMaintenance).isEmpty()) { > Not sure this check is correct. I am not entirely sure about this one. But for now I'll remove it. Line 113: return failCanDoAction(VdcBllMessages.ERROR_CANNOT_DEACTIVATE_MASTER_WITH_LOCKED_DOMAINS); Line 114: } Line 115: } Line 116: if (!getParameters().getIsInternal() http://gerrit.ovirt.org/#/c/22045/5/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/StorageDomainStatus.java File backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/StorageDomainStatus.java: Line 18: return values()[value]; Line 19: } Line 20: Line 21: public boolean isLocked() { Line 22: return this == Locked || this == MovingToMaintenance; > why is this considered locked? We can try to find a better name, but in general when a domain is moving to maintenance is very similar to a locked domain, you can't do most of the actions. The only action allowed is to try to deactivate it again (almost useless) or re-activate it. Line 23: } http://gerrit.ovirt.org/#/c/22045/5/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/irsbroker/DomainVisibility.java File backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/irsbroker/DomainVisibility.java: Line 9: Line 10: Line 11: public class DomainVisibility { Line 12: Line 13: public enum Status { > should be static Done Line 14: VISIBLE, Line 15: UNREPORTED, Line 16: UNREACHABLE, Line 17: } http://gerrit.ovirt.org/#/c/22045/5/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/irsbroker/IrsBrokerCommand.java File backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/irsbroker/IrsBrokerCommand.java: Line 1010: mCurrentVdsId = null; Line 1011: } Line 1012: Line 1013: private final DomainVisibility _domainsVisibility = new DomainVisibility(); Line 1014: > Please, remove "_". Done Line 1015: private static Map<Guid, VDSDomainsData> getDataDomainsMap(ArrayList<VDSDomainsData> domainsDataList) { Line 1016: Map<Guid, VDSDomainsData> dataDomainMap = new HashMap<>(); Line 1017: for (VDSDomainsData domainsData : domainsDataList) { Line 1018: dataDomainMap.put(domainsData.getDomainId(), domainsData); Line 1059: } Line 1060: } Line 1061: } Line 1062: Line 1063: private void moveDomainToMaintenance(StorageDomain poolDomain) { > Please, change poolDomain to just domain. Done Line 1064: // This is relevant only for domains that are in the process of being moved to maintenance Line 1065: if (poolDomain.getStatus() != StorageDomainStatus.MovingToMaintenance) { Line 1066: return; Line 1067: } Line 1065: if (poolDomain.getStatus() != StorageDomainStatus.MovingToMaintenance) { Line 1066: return; Line 1067: } Line 1068: Line 1069: for (VDS poolVds : DbFacade.getInstance().getVdsDao().getAllForStoragePool(_storagePoolId)) { > I would use hosts instead of poolVds. Done Line 1070: // Skip vds that are in maintenance Line 1071: if (poolVds.getStatus() == VDSStatus.Maintenance) { Line 1072: continue; Line 1073: } Line 1072: continue; Line 1073: } Line 1074: Line 1075: if (!_domainsVisibility.isDomainUnreportedByVds(poolVds.getId(), poolDomain.getId())) { Line 1076: // Domain is still visible or unreachable by one vds, cannot move to maintenance > Please, add appropriate log message here. Unreachable by which host. I am worried to flood the logs, this may happen every second for each vds until the problem is resolved. Line 1077: return; Line 1078: } Line 1079: } Line 1080: -- To view, visit http://gerrit.ovirt.org/22045 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I55cd5aa6a6dc32f374a4bb21b159d3cb30da65f5 Gerrit-PatchSet: 5 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli <[email protected]> Gerrit-Reviewer: Allon Mureinik <[email protected]> Gerrit-Reviewer: Ayal Baron <[email protected]> Gerrit-Reviewer: Daniel Erez <[email protected]> Gerrit-Reviewer: Federico Simoncelli <[email protected]> Gerrit-Reviewer: Liron Ar <[email protected]> Gerrit-Reviewer: Sergey Gotliv <[email protected]> Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
