storage: don't select an SSVM that is removed (#3668)

In case an older SSVM is removed without changing it's state from Up
to Destroyed/Removed etc, the SSVM may be randomly selected for image
store related operations. This fix ensures that endpoints for an image
store are found only from a set of SSVM hosts that are not removed.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2019-11-12 00:47:21 +05:30 committed by GitHub
parent a9b4da621e
commit 7f5096a4d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -263,6 +263,7 @@ public class DefaultEndPointSelector implements EndPointSelector {
}
sc.and(sc.entity().getStatus(), Op.IN, Status.Up, Status.Connecting);
sc.and(sc.entity().getType(), Op.EQ, Host.Type.SecondaryStorageVM);
sc.and(sc.entity().getRemoved(), Op.NULL);
return sc.list();
}