Skip to content

Commit 7cf15d6

Browse files
authored
Merge pull request #100413 from zhenxuanjameszhang/patch-2
Add recommendation based on recent incident RCA
2 parents bcbbc46 + 2df9a08 commit 7cf15d6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

articles/service-fabric/service-fabric-reliable-services-reliable-collections-guidelines.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ The guidelines are organized as simple recommendations prefixed with the terms *
2828
* Consider using backup and restore functionality to have disaster recovery.
2929
* Avoid mixing single entity operations and multi-entity operations (e.g `GetCountAsync`, `CreateEnumerableAsync`) in the same transaction due to the different isolation levels.
3030
* Do handle InvalidOperationException. User transactions can be aborted by the system for variety of reasons. For example, when the Reliable State Manager is changing its role out of Primary or when a long-running transaction is blocking truncation of the transactional log. In such cases, user may receive InvalidOperationException indicating that their transaction has already been terminated. Assuming, the termination of the transaction was not requested by the user, best way to handle this exception is to dispose the transaction, check if the cancellation token has been signaled (or the role of the replica has been changed), and if not create a new transaction and retry.
31+
* Do not apply any parallelism within a transaction.
32+
* Consider dispose transaction as soon as possible after commit completes (especially if using ConcurrentQueue).
33+
* Do not perform any blocking code inside a transaction.
3134

3235
Here are some things to keep in mind:
3336

0 commit comments

Comments
 (0)