Skip to content

Commit 81b4989

Browse files
author
Vlade Lekic
committed
Expanding with codes.
1 parent 7d9ca46 commit 81b4989

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

articles/service-fabric/service-fabric-cluster-resource-manager-movement-cost.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,22 @@ this.Partition.ReportMoveCost(MoveCost.Medium);
6464

6565
## Reporting move cost for a partition
6666

67-
The previous section describes how service replicas or instances report MoveCost themselves. We provided Service Fabric API for reporting MoveCost values on behalf of other partitions. Sometimes service replica or instance can't determine the best MoveCost value by itself, and must relay on other services logic. Reporting MoveCost on behalf of other partitions, alongside with [reporting load on behalf of other partitions](service-fabric-cluster-resource-manager-metrics.md#reporting-load-for-a-partition), allows you to completely manage partitions from outside. These APIs eliminate needs for [the Sidecar pattern](https://docs.microsoft.com/azure/architecture/patterns/sidecar), from the perspective of Cluster Resource Manager.
67+
The previous section describes how service replicas or instances report MoveCost themselves. We provided Service Fabric API for reporting MoveCost values on behalf of other partitions. Sometimes service replica or instance can't determine the best MoveCost value by itself, and must rely on other services logic. Reporting MoveCost on behalf of other partitions, alongside with [reporting load on behalf of other partitions](service-fabric-cluster-resource-manager-metrics.md#reporting-load-for-a-partition), allows you to completely manage partitions from outside. These APIs eliminate needs for [the Sidecar pattern](https://docs.microsoft.com/azure/architecture/patterns/sidecar), from the perspective of the Cluster Resource Manager.
6868

6969
You can report MoveCost updates for a different partitions with same API call. You need to specify PartitionMoveCostDescription object for each partition that you want to update with new values of MoveCost. The API allows multiple ways to update MoveCost:
7070

7171
- A stateful service partition can update its primary replica MoveCost.
7272
- Both stateless and stateful services can update the MoveCost of all its secondary replicas or instances.
7373
- Both stateless and stateful services can update the MoveCost of a specific replica or instance on a node.
7474

75+
Each MoveCost update for partition should contain at least one valid value that will be changed. For example, you could skip primary replica update with assigning _null_ to primary replica entry, other entries will be used during MoveCost update and we will skip MoveCost update for primary replica. Since updating of MoveCost for multiple partitions with single API call is possible, API provides a list of return codes for corresponding partition. If we successfully accept and process a request for MoveCost update, return code will be Success. Otherwise, API provides error code:
76+
77+
- PartitionNotFound - Specified partition ID doesn't exist.
78+
- ReconfigurationPending - Partition is currently reconfiguring.
79+
- InvalidForStatelessServices - An attempt was made to change the MoveCost of a primary replica for a partition belonging to a stateless service.
80+
- ReplicaDoesNotExist - Secondary replica or instance does not exist on a specified node.
81+
- InvalidOperation - Updating MoveCost for a partition that belongs to the System application.
82+
7583
C#:
7684

7785
```csharp

0 commit comments

Comments
 (0)