Allon Mureinik has posted comments on this change. Change subject: core: NPEs and wrong persisted information when reusing LUNs ......................................................................
Patch Set 4: (6 inline comments) see inline - started reviewing during your rebase - publishing the review just to save the comments, will go over the new patchset in a second. .................................................... File backend/manager/dbscripts/storages_san_sp.sql Line 22: Line 23: Line 24: Line 25: Line 26: Create or replace FUNCTION UpdateLUNsVolumeGroupId(v_LUN_id VARCHAR(50), why not use the regular update? Line 27: v_volume_group_id VARCHAR(50)) Line 28: RETURNS VOID Line 29: AS $procedure$ Line 30: BEGIN .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/ISCSIStorageHelper.java Line 196: if (DbFacade.getInstance().getDiskLunMapDao().getDiskIdByLunId(lun.getLUN_id()) == null) { Line 197: DbFacade.getInstance().getLunDao().remove(lun.getLUN_id()); Line 198: numOfRemovedLuns++; Line 199: } else { Line 200: DbFacade.getInstance().getLunDao().updateLUNsVolumeGroupId(lun.getLUN_id(), ""); use getLunDao() instead of DbFacade.getInstance().getLunDao(). Also, why use an empty string and not just null? Line 201: } Line 202: } Line 203: if (numOfRemovedLuns > 0) { Line 204: for (storage_server_connections connection : FilterConnectionsUsedByOthers(list, storageDomain.getstorage())) { .................................................... 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,""); why not null? 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/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) { Move this function - all the getters should be together, and all the modifications together. 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); something in the indentation here looks funky. Does it look OK in eclipse? Line 53: Line 54: getCallsHandler().executeModification("UpdateLUNsVolumeGroupId", parameterSource); Line 55: } Line 56: Line 61: .addValue("storage_server_connection", id); Line 62: Line 63: return getCallsHandler().executeReadList("GetLUNsBystorage_server_connection", MAPPER, parameterSource); Line 64: } Line 65: Removing the warning here is unrelated to the patch, Line 66: @Override Line 67: public List<LUNs> getAllForVolumeGroup(String id) { Line 68: MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource() Line 69: .addValue("volume_group_id", id); -- 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: 4 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