Liron Aravot has posted comments on this change.

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


Patch Set 7: (5 inline comments)

....................................................
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);
will add
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());
If you referred to the query, there's no need to load the connections if we 
aren't removing any luns.
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/StorageHelperBase.java
Line 129:         final List<LUNs> lunsList = 
DbFacade.getInstance().getLunDao().getAllForVolumeGroup(storageDomain.getstorage());
Line 130:         int numOfRemovedLuns = 0;
Line 131:         for (LUNs lun : lunsList) {
Line 132:             if 
(DbFacade.getInstance().getDiskLunMapDao().getDiskIdByLunId(lun.getLUN_id()) == 
null) {
Line 133:                 
DbFacade.getInstance().getLunDao().remove(lun.getLUN_id());
Will do.
Line 134:                 numOfRemovedLuns++;
Line 135:             } else {
Line 136:                 
DbFacade.getInstance().getLunDao().updateLUNsVolumeGroupId(lun.getLUN_id(), "");
Line 137:             }


Line 130:         int numOfRemovedLuns = 0;
Line 131:         for (LUNs lun : lunsList) {
Line 132:             if 
(DbFacade.getInstance().getDiskLunMapDao().getDiskIdByLunId(lun.getLUN_id()) == 
null) {
Line 133:                 
DbFacade.getInstance().getLunDao().remove(lun.getLUN_id());
Line 134:                 numOfRemovedLuns++;
numOfRemovedLuns it's being returned. I prefer to not add a print to the log is 
 as it won't give relevant info and will just add more prints.
Line 135:             } else {
Line 136:                 
DbFacade.getInstance().getLunDao().updateLUNsVolumeGroupId(lun.getLUN_id(), "");
Line 137:             }
Line 138:         }


Line 132:             if 
(DbFacade.getInstance().getDiskLunMapDao().getDiskIdByLunId(lun.getLUN_id()) == 
null) {
Line 133:                 
DbFacade.getInstance().getLunDao().remove(lun.getLUN_id());
Line 134:                 numOfRemovedLuns++;
Line 135:             } else {
Line 136:                 
DbFacade.getInstance().getLunDao().updateLUNsVolumeGroupId(lun.getLUN_id(), "");
Any constant longer than 2 chars is longer than "" :-) so i prefer leave it 
that way.
Line 137:             }
Line 138:         }
Line 139:         return numOfRemovedLuns;
Line 140:     }


--
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

Reply via email to