forked from Azure/azure-cosmos-dotnet-v3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Client Encryption: Removes retry behavior for point operations during…
… client encryption policy change. (Azure#2648) - changes the retry logic where few operations (create/read/upsert etc) were retried upon failure due to policy changes. With this PR this retry has been removed and we just refresh the policy. This is to align with and have a uniform behavior across, since few operations like batch, feed cannot be retried, and the stream dispose behavior (when operation fails) seems to be inconsistent with bulk. - adds fix for patch operation to pick up (and refresh the cache with) the correct encryption policy when the client has cached incorrect/stale policy which can happen when container is deleted and recreated with same id but with a different encryption policy.
- Loading branch information
1 parent
c107a40
commit dd31c66
Showing
6 changed files
with
415 additions
and
198 deletions.
There are no files selected for viewing
237 changes: 68 additions & 169 deletions
237
Microsoft.Azure.Cosmos.Encryption/src/EncryptionContainer.cs
Large diffs are not rendered by default.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
Microsoft.Azure.Cosmos.Encryption/src/EncryptionCosmosException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// ------------------------------------------------------------ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// ------------------------------------------------------------ | ||
|
||
namespace Microsoft.Azure.Cosmos.Encryption | ||
{ | ||
using System; | ||
using System.Net; | ||
|
||
internal sealed class EncryptionCosmosException : CosmosException | ||
{ | ||
private readonly CosmosDiagnostics encryptionCosmosDiagnostics; | ||
|
||
public EncryptionCosmosException( | ||
string message, | ||
HttpStatusCode statusCode, | ||
int subStatusCode, | ||
string activityId, | ||
double requestCharge, | ||
CosmosDiagnostics encryptionCosmosDiagnostics) | ||
: base(message, statusCode, subStatusCode, activityId, requestCharge) | ||
{ | ||
this.encryptionCosmosDiagnostics = encryptionCosmosDiagnostics ?? throw new ArgumentNullException(nameof(encryptionCosmosDiagnostics)); | ||
} | ||
|
||
public override CosmosDiagnostics Diagnostics => this.encryptionCosmosDiagnostics; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.