From 380f8c57c10489206ae0d1f0735687e21e126635 Mon Sep 17 00:00:00 2001 From: Matias Quaranta Date: Wed, 5 Jan 2022 14:35:47 -0800 Subject: [PATCH] renamed variable --- Microsoft.Azure.Cosmos/src/GatewayStoreModel.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/GatewayStoreModel.cs b/Microsoft.Azure.Cosmos/src/GatewayStoreModel.cs index 19835deadc..d5623e9a8e 100644 --- a/Microsoft.Azure.Cosmos/src/GatewayStoreModel.cs +++ b/Microsoft.Azure.Cosmos/src/GatewayStoreModel.cs @@ -265,8 +265,8 @@ internal static async Task ApplySessionTokenAsync( } string requestConsistencyLevel = request.Headers[HttpConstants.HttpHeaders.ConsistencyLevel]; - bool isConsideredAReadRequest = request.IsReadOnlyRequest || request.OperationType == OperationType.Batch; - bool requestHasConsistencySet = !string.IsNullOrEmpty(requestConsistencyLevel) && isConsideredAReadRequest; // Only read requests can have their consistency modified + bool isReadOrBatchRequest = request.IsReadOnlyRequest || request.OperationType == OperationType.Batch; + bool requestHasConsistencySet = !string.IsNullOrEmpty(requestConsistencyLevel) && isReadOrBatchRequest; // Only read requests can have their consistency modified bool sessionConsistencyApplies = (!requestHasConsistencySet && defaultConsistencyLevel == ConsistencyLevel.Session) || @@ -276,7 +276,7 @@ internal static async Task ApplySessionTokenAsync( bool isMultiMasterEnabledForRequest = globalEndpointManager.CanUseMultipleWriteLocations(request); if (!sessionConsistencyApplies - || (!isConsideredAReadRequest + || (!isReadOrBatchRequest && !isMultiMasterEnabledForRequest)) { return; // Only apply the session token in case of session consistency and the request is read only or read/write on multimaster