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.
This commit is contained in:
Harikrishna 2023-07-03 12:58:42 +05:30 committed by GitHub
parent de6ce503dc
commit 70820137e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 5 deletions

View File

@ -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;
}