microsoft / service-fabric

Service Fabric is a distributed systems platform for packaging, deploying, and managing stateless and stateful distributed applications and containers at large scale.
https://docs.microsoft.com/en-us/azure/service-fabric/
MIT License
3.03k stars 399 forks source link

Instance count -1 with 0 instances #531

Open hbuckle opened 4 years ago

hbuckle commented 4 years ago

Our services are stateless and set to -1 instance count. We are using placement constraints to confine them to specific node types. For our dev/test cluster we would like to scale the node type scale set down to 0 instances out of hours - when we do this the services go into error state:

'System.FM' reported Error for property 'State'.
Partition is below target replica or instance count.
fabric:/ClearBank.HelloWorld.ServiceFabric/ClearBank.HelloWorld.Api -1 1 de4fff4a-65dd-45f8-912d-b99ff34450ca
  (Showing 0 out of 0 instances. Total available instances: 0)

Is this expected behaviour? I would have expected that with instance count -1 and no nodes meeting the placement constraints then service fabric would not do anything, rather than reporting errors.

Service Fabric Runtime and SDK Version :

6.5.676.9590

Operating System :

Windows

masnider commented 4 years ago

SF doesn't know why the nodes are down, so this looks like failure, and then SF cannot satisfy the placement constraint for the service AND get you into the desired configuration (SF presumes you want the service to be up, and it can't make the service up AND respect the constraint that it be placed on that specific node type).

What would you like to alter about the error? Also, if the intention is to remove the service, does deleting it work? Or what about the scenario isn’t met there?

steve-hawkins commented 4 years ago

@masnider the scenario is scheduled load, elasticity and cost optimisation rather than the removal of the service

it doesn't feel right to leave the scheduling of the service availability to a CI/CD pipeline rather than VMSS auto-scale rules