Skip to content

Commit 79941eb

Browse files
committed
More niceties
1 parent fda84ce commit 79941eb

File tree

1 file changed

+21
-29
lines changed

1 file changed

+21
-29
lines changed

articles/service-fabric/service-fabric-application-upgrade-advanced.md

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,45 +13,39 @@ If a new service type is added to a published application as part of an upgrade,
1313

1414
Similarly, service types can be removed from an application as part of an upgrade. However, all service instances of the to-be-removed service type must be removed before proceeding with the upgrade (see [Remove-ServiceFabricService](https://docs.microsoft.com/powershell/module/servicefabric/remove-servicefabricservice?view=azureservicefabricps)).
1515

16-
## Avoid connection drops during planned downtime of stateless services
16+
## Avoid connection drops during stateless service planned downtime (preview)
1717

18-
For planned stateless instance downtime, like when the application/cluster is upgraded or nodes are getting deactivated, there are a few connections drops which are observed because the endpoint exposed by the instances is removed after it goes down.
18+
For planned stateless instance downtimes, such as application/cluster upgrade or node deactivation, connections can get dropped due to the exposed endpoint being removed after it goes down.
1919

20-
To avoid getting connections drops for planned downtime, the request drain feature has been enabled which can be configured by adding a replica close delay duration in the service configuration. This would be used to delay the close of the stateless Instance. The endpoint advertised by the stateless Instance is removed, before we start the delay timer prior to closing this Instance. This delay duration would give existing requests to drain gracefully before the instance actually goes down. This endpoint change is advertised to the clients, and they would have to resolve the endpoints again, so that they do not send new requests to the instance which is going down.
20+
To avoid this, configure the *RequestDrain* (preview) feature by adding a replica *instance close delay duration* in the service configuration. This ensures the endpoint advertised by the stateless instance is removed *before* the delay timer starts for closing the instance. This delay enables existing requests to drain gracefully before the instance actually goes down. Clients are notified of the endpoint change by callback function, so they can re-resolve the endpoint and avoid sending new requests to the instance going down.
2121

2222
### Service configuration
2323

24-
The delay can be configured in the service in following ways:
24+
There are several ways to configure the delay on the service side.
2525

26-
#### When creating a new service
26+
* **When creating a new service**, specify a `-InstanceCloseDelayDuration`:
2727

28-
By setting an `-InstanceCloseDelayDuration` value:
28+
```powershell
29+
New-ServiceFabricService -Stateless [-ServiceName] <Uri> -InstanceCloseDelayDuration <TimeSpan>`
30+
```
2931
30-
```powershell
31-
New-ServiceFabricService -Stateless [-ServiceName] <Uri> -InstanceCloseDelayDuration <TimeSpan>`
32-
```
33-
34-
#### While defining the service in the defaults section in the application manifest
35-
36-
With the `InstanceCloseDelayDurationSeconds` property:
37-
38-
```xml
39-
<StatelessService ServiceTypeName="Web1Type" InstanceCount="[Web1_InstanceCount]" InstanceCloseDelayDurationSeconds="15">
40-
<SingletonPartition />
41-
</StatelessService>
42-
```
32+
* **While defining the service in the defaults section in the application manifest**, assign the `InstanceCloseDelayDurationSeconds` property:
4333
44-
#### When updating an existing service
34+
```xml
35+
<StatelessService ServiceTypeName="Web1Type" InstanceCount="[Web1_InstanceCount]" InstanceCloseDelayDurationSeconds="15">
36+
<SingletonPartition />
37+
</StatelessService>
38+
```
4539
46-
By setting an `-InstanceCloseDelayDuration` value:
40+
* **When updating an existing service**, specify a `-InstanceCloseDelayDuration`:
4741
48-
```powershell
49-
Update-ServiceFabricService [-Stateless] [-ServiceName] <Uri> [-InstanceCloseDelayDuration <TimeSpan>]`
50-
```
42+
```powershell
43+
Update-ServiceFabricService [-Stateless] [-ServiceName] <Uri> [-InstanceCloseDelayDuration <TimeSpan>]`
44+
```
5145
5246
### Client configuration
5347
54-
Since we remove the endpoint advertised by an instance and then start the delay timer before we close the Instance down, the clients will get a change notification for the endpoints updated for which they would need to register a callback (`ServiceManager_ServiceNotificationFilterMatched`) like this:
48+
To receive notification when an endpoint has changed, clients can register a callback (`ServiceManager_ServiceNotificationFilterMatched`) like this:
5549
5650
```csharp
5751
var filterDescription = new ServiceNotificationFilterDescription
@@ -72,17 +66,15 @@ The change notification is an indication that the endpoints have changed, the cl
7266

7367
### Optional upgrade overrides
7468

75-
Apart from the pre-configured delay duration, you also have the option to override the delay, at the time of initiating an application/cluster upgrade using the same (`InstanceCloseDelayDurationSec`) option:
69+
In addition to setting default delay durations per service, you can also override the delay during application/cluster upgrade using the same (`InstanceCloseDelayDurationSec`) option:
7670

7771
```powershell
7872
Start-ServiceFabricApplicationUpgrade [-ApplicationName] <Uri> [-ApplicationTypeVersion] <String> [-InstanceCloseDelayDurationSec <UInt32>]
7973
8074
Start-ServiceFabricClusterUpgrade [-CodePackageVersion] <String> [-ClusterManifestVersion] <String> [-InstanceCloseDelayDurationSec <UInt32>]
8175
```
8276

83-
This delay duration will only be valid for this instance of the upgrade and will not change the individual service delay configurations. For example, you can use this to give a 0 delay, to run through an upgrade and not wait for the pre-configured delay.
84-
85-
77+
The delay duration only applies to the invoked upgrade instance and does not otherwise change individual service delay configurations. For example, you can use this to specify a `0` delay, to run through an upgrade and not wait for the pre-configured delay.
8678

8779
## Manual upgrade mode
8880

0 commit comments

Comments
 (0)