Liron Aravot has posted comments on this change. Change subject: core: NPEs and wrong persisted information when reusing LUNs ......................................................................
Patch Set 7: (7 inline comments) .................................................... File backend/manager/dbscripts/storages_san_sp.sql Line 23: Line 24: Line 25: Line 26: Create or replace FUNCTION UpdateLUNsVolumeGroupId(v_LUN_id VARCHAR(50), Line 27: v_volume_group_id VARCHAR(50)) answered there. Line 28: RETURNS VOID Line 29: AS $procedure$ Line 30: BEGIN Line 31: UPDATE LUNs set volume_group_id = v_volume_group_id where LUN_id = v_LUN_ID; .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImagesHandler.java Line 673: if (!lun.getLunConnections().isEmpty()) { Line 674: StorageHelperDirector.getInstance().getItem( Line 675: lun.getLunConnections().get(0).getstorage_type()).removeLun(lun); Line 676: } else { Line 677: StorageHelperDirector.getInstance().getItem(StorageType.FCP).removeLun(lun); If there are no connections then the lun is FCP, as the lun type isn't persisted and checked all over the code by the lun connections (if they exist or not) - the same handling was added here. Line 678: } Line 679: Line 680: } Line 681: .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ISCSIStorageHelper.java Line 190: public boolean StorageDomainRemoved(storage_domain_static storageDomain) { Line 191: int numOfRemovedLuns = removeStorageDomainLuns(storageDomain); Line 192: if (numOfRemovedLuns > 0) { Line 193: List<storage_server_connections> list = DbFacade.getInstance() Line 194: .getStorageServerConnectionDao().getAllForVolumeGroup(storageDomain.getstorage()); the first action performed by this method is needed for the FCP storage helper as well, so it moved to a function upper in the hierarchy in order to avoid code duplication. Line 195: for (storage_server_connections connection : FilterConnectionsUsedByOthers(list, storageDomain.getstorage())) { Line 196: DbFacade.getInstance().getStorageServerConnectionDao().remove(connection.getid()); Line 197: } Line 198: } .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StorageDomainCommandBase.java Line 226: } Line 227: } Line 228: Line 229: public static void proceedLUNInDb(final LUNs lun, StorageType storageType) { Line 230: proceedLUNInDb(lun,storageType,""); answered there. Line 231: } Line 232: Line 233: public static void proceedLUNInDb(final LUNs lun, StorageType storageType, String volumeGroupId) { Line 234: if (DbFacade.getInstance().getLunDao().get(lun.getLUN_id()) == null) { .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StorageHelperBase.java Line 133: DbFacade.getInstance().getLunDao().remove(lun.getLUN_id()); Line 134: numOfRemovedLuns++; Line 135: } else { Line 136: DbFacade.getInstance().getLunDao().updateLUNsVolumeGroupId(lun.getLUN_id(), ""); Line 137: } answered in patchset 4. Line 138: } Line 139: return numOfRemovedLuns; Line 140: } Line 141: .................................................... File backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/LunDAODbFacadeImpl.java Line 46: return getCallsHandler().executeRead("GetLUNByLUNId", MAPPER, parameterSource); Line 47: } Line 48: Line 49: @Override Line 50: public void updateLUNsVolumeGroupId(String id, String volumeGroupId) { answered there. Line 51: MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource().addValue("LUN_id", id) Line 52: .addValue("volume_group_id", volumeGroupId); Line 53: Line 54: getCallsHandler().executeModification("UpdateLUNsVolumeGroupId", parameterSource); Line 48: Line 49: @Override Line 50: public void updateLUNsVolumeGroupId(String id, String volumeGroupId) { Line 51: MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource().addValue("LUN_id", id) Line 52: .addValue("volume_group_id", volumeGroupId); answered there. Line 53: Line 54: getCallsHandler().executeModification("UpdateLUNsVolumeGroupId", parameterSource); Line 55: } Line 56: -- To view, visit http://gerrit.ovirt.org/9229 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I38a0e3c68cb8bd80c2f78ee5aacfccc8c987a79e Gerrit-PatchSet: 7 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Liron Aravot <lara...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Ayal Baron <aba...@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: Vered Volansky <vvola...@redhat.com> Gerrit-Reviewer: liron aravot <liron.ara...@gmail.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches