service-fabric
service-fabric copied to clipboard
[Feature]: Provide callback to be called when partition-based autoscaling is about to destructively scale down
Is your feature request related to a problem? Please describe your workload details. Partition-based scaling allows one to dynamically configure a service to use more or fewer partitions based on the value of some metric. It's limited to using named partitions using the approach "1" -> add one -> "2" -> add one -> "3" -> remove one -> "2".
There is a warning given that when auto-scaling scales down, it will delete data from partitions without hesitation or warning.
This functionality absent the scale-down behavior would be pretty useful in a scenario I'm considering, so I'd like to ask that you provide a method I can register an override for that provides notice about the current named partitions, names the one that's fixing to be destroyed and provides a cancellation token so I might take steps to move the data off the partition in advance of the scale-down operation.
Describe the solution you'd like Ideally, there's an async method I can override in the FabricClient that is called when a scale-down operation is scheduled to occur within the service. It provides the name(s) of the partitions that are scheduled for deletion and the name(s) of the partitions scheduled to remain following the deletion operation and gives me a reasonable amount of time to then move the data off the partitions and distribute it onto the remaining partitions as necessary. Only upon receiving a Task.CompletedTask then, does Service Fabric proceed with the partition deletion.
Describe alternatives you've considered Right now, there's no functionality I've seen in Service Fabric that otherwise gives me the ability to change partitions after a service has been deployed, so I'm not aware of other alternatives.
Area/Component: Placement, resource governance
Expected behavior It provides another auto-scale functionality to developers, this time for stateful services which have been traditionally locked to fixed partition sizes upfront.
Additional context Ideally, this could be implemented alongside this feature request as well.
Service Fabric Runtime Version: All
Environment: Azure, Standalone, Dev
Assignees: /cc @microsoft/service-fabric-triage