Liron Aravot has posted comments on this change.

Change subject: core: NPEs and wrong persisted information when reusing LUNs
......................................................................


Patch Set 4: (6 inline comments)

....................................................
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),
there's no regular update and no reason to add one at the moment. all other lun 
information can't be changed as we get it from the storage server and just 
persist it.
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(), "");
will add getLunDao() method.

when adding a lun it's volume_group_id is being added as "", no reason to 
change it to null and lead to have inconsistent data stored in the DB.
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,"");
when adding a lun it's volume_group_id is being added as "", no reason to 
change it to null and lead to have inconsistent data stored in the DB.
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) {
Done
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);
yep
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: 
Done
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

Reply via email to