diff --git a/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs b/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs index b69ad489c6..418157c246 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs @@ -554,7 +554,8 @@ internal Tuple ToPartiti addressInfo.PhysicalUri); HashSet pkRangeIdSet = this.serverPartitionAddressToPkRangeIdMap.GetOrAdd( - new ServerKey(new Uri(addressInfo.PhysicalUri)), new HashSet()); + new ServerKey(new Uri(addressInfo.PhysicalUri)), + (_) => new HashSet()); lock (pkRangeIdSet) { pkRangeIdSet.Add(partitionKeyRangeIdentity); diff --git a/Microsoft.Azure.Cosmos/src/Routing/GlobalPartitionEndpointManagerCore.cs b/Microsoft.Azure.Cosmos/src/Routing/GlobalPartitionEndpointManagerCore.cs index b82d3ece8e..a4ab1221e6 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/GlobalPartitionEndpointManagerCore.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/GlobalPartitionEndpointManagerCore.cs @@ -134,7 +134,7 @@ public override bool TryMarkEndpointUnavailableForPartitionKeyRange( PartitionKeyRangeFailoverInfo partionFailover = this.PartitionKeyRangeToLocation.Value.GetOrAdd( partitionKeyRange, - new PartitionKeyRangeFailoverInfo(failedLocation)); + (_) => new PartitionKeyRangeFailoverInfo(failedLocation)); // Will return true if it was able to update to a new region if (partionFailover.TryMoveNextLocation(