From 70820137e642e026b20773214684fc2af816b856 Mon Sep 17 00:00:00 2001 From: Harikrishna Date: Mon, 3 Jul 2023 12:58:42 +0530 Subject: [PATCH] scaleio: Avoid race condition while handling host disconnect and connect scenarios (#282) (#7689) This PR fixes an intermittent issue where SDC id (local_path) is getting deleted and not getting populated when host connects back again. Fix is to remove the code to delete the records from storage_pool_host_ref table. We are anyways updating the entry if the SDC ID is changed during agent restart which is anyways required inorder to get the new connections. I've quickly verified the host delete scenario to check the storage_pool_host_ref entries behavior, entries are getting deleted. --- .../storage/datastore/provider/ScaleIOHostListener.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/plugins/storage/volume/scaleio/src/main/java/org/apache/cloudstack/storage/datastore/provider/ScaleIOHostListener.java b/plugins/storage/volume/scaleio/src/main/java/org/apache/cloudstack/storage/datastore/provider/ScaleIOHostListener.java index 68044baf170..bb269e85a95 100644 --- a/plugins/storage/volume/scaleio/src/main/java/org/apache/cloudstack/storage/datastore/provider/ScaleIOHostListener.java +++ b/plugins/storage/volume/scaleio/src/main/java/org/apache/cloudstack/storage/datastore/provider/ScaleIOHostListener.java @@ -171,11 +171,7 @@ public class ScaleIOHostListener implements HypervisorHostListener { @Override public boolean hostDisconnected(long hostId, long poolId) { - StoragePoolHostVO storagePoolHost = _storagePoolHostDao.findByPoolHost(poolId, hostId); - if (storagePoolHost != null) { - _storagePoolHostDao.deleteStoragePoolHostDetails(hostId, poolId); - } - + // SDC ID is getting updated upon host connect, no need to delete the storage_pool_host_ref entry return true; }