Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
eb7b0a0
Code changes to retry on next preferred region for metadata reads on …
kundadebdatta Nov 9, 2023
ec125de
Code changes to add retry for PK Ranges call.
kundadebdatta Dec 6, 2023
483cc45
Code changes to mark endpoint unavailable for read when cosmos except…
kundadebdatta Dec 7, 2023
cc4657f
Code changes to fix unit tests. Added global endpoint manager in Pk R…
kundadebdatta Dec 8, 2023
dbee389
Code changes to fix unit tests.
kundadebdatta Dec 8, 2023
505ee41
Code changes to fix build break.
kundadebdatta Dec 8, 2023
77bc01d
Minor code clean-up.
kundadebdatta Dec 8, 2023
c26bbb9
Code changes to capture metadata location endpoint within on before s…
kundadebdatta Dec 19, 2023
416cb6e
Code changes to address review comments.
kundadebdatta Dec 19, 2023
ba31430
Code changes to fix build failure.
kundadebdatta Dec 19, 2023
dab70d0
Code changes to refactor metadata timeout policy.
kundadebdatta Dec 20, 2023
2e4cfc7
Code changes to add retry for request timeout. Fix emulator tests.
kundadebdatta Dec 20, 2023
697f9be
Code changes to add metadata retry policy unit tests.
kundadebdatta Dec 21, 2023
bcb2222
Code changes to add more tests.
kundadebdatta Dec 21, 2023
621bd64
Merge branch 'master' into users/kundadebdatta/4181_retry_metadata_re…
kundadebdatta Dec 21, 2023
0204173
Code changes to refactor metadata retry policy logic to increment loc…
kundadebdatta Dec 22, 2023
6724c77
Merge branch 'master' into users/kundadebdatta/4181_retry_metadata_re…
kundadebdatta Dec 22, 2023
b507ed2
Code changes to address review comments.
kundadebdatta Dec 22, 2023
2f427e3
Code changes to address review comments.
kundadebdatta Dec 29, 2023
a20af65
Code changes to add separate condition for pk range requests.
kundadebdatta Dec 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Code changes to fix unit tests.
  • Loading branch information
kundadebdatta committed Dec 8, 2023
commit dbee389f7402ac8fcf72bc86fe26245c48ca0e36
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ await GatewayStoreModel.ApplySessionTokenAsync(
dsr,
ConsistencyLevel.Session,
new Mock<ISessionContainer>().Object,
partitionKeyRangeCache: new Mock<PartitionKeyRangeCache>(null, null, null).Object,
partitionKeyRangeCache: new Mock<PartitionKeyRangeCache>(null, null, null, null).Object,
clientCollectionCache: new Mock<ClientCollectionCache>(new SessionContainer("testhost"), gatewayStoreModel, null, null, null).Object,
globalEndpointManager: Mock.Of<IGlobalEndpointManager>());

Expand All @@ -301,7 +301,7 @@ await GatewayStoreModel.ApplySessionTokenAsync(
dsrQueryPlan,
ConsistencyLevel.Session,
new Mock<ISessionContainer>().Object,
partitionKeyRangeCache: new Mock<PartitionKeyRangeCache>(null, null, null).Object,
partitionKeyRangeCache: new Mock<PartitionKeyRangeCache>(null, null, null, null).Object,
clientCollectionCache: new Mock<ClientCollectionCache>(new SessionContainer("testhost"), gatewayStoreModel, null, null, null).Object,
globalEndpointManager: Mock.Of<IGlobalEndpointManager>());

Expand Down Expand Up @@ -355,7 +355,7 @@ await GatewayStoreModel.ApplySessionTokenAsync(
dsr,
ConsistencyLevel.Session,
new Mock<ISessionContainer>().Object,
partitionKeyRangeCache: new Mock<PartitionKeyRangeCache>(null, null, null).Object,
partitionKeyRangeCache: new Mock<PartitionKeyRangeCache>(null, null, null, null).Object,
clientCollectionCache: new Mock<ClientCollectionCache>(new SessionContainer("testhost"), gatewayStoreModel, null, null, null).Object,
globalEndpointManager: Mock.Of<IGlobalEndpointManager>());

Expand Down Expand Up @@ -385,7 +385,7 @@ await GatewayStoreModel.ApplySessionTokenAsync(
dsrNoSessionToken,
ConsistencyLevel.Session,
sessionContainer,
partitionKeyRangeCache: new Mock<PartitionKeyRangeCache>(null, null, null).Object,
partitionKeyRangeCache: new Mock<PartitionKeyRangeCache>(null, null, null, null).Object,
clientCollectionCache: new Mock<ClientCollectionCache>(new SessionContainer("testhost"), gatewayStoreModel, null, null, null).Object,
globalEndpointManager: globalEndpointManager.Object);

Expand Down Expand Up @@ -426,7 +426,7 @@ await GatewayStoreModel.ApplySessionTokenAsync(
It.IsAny<CancellationToken>(),
NoOpTrace.Singleton)).Returns(Task.FromResult(containerProperties));

Mock<PartitionKeyRangeCache> mockPartitionKeyRangeCache = new Mock<PartitionKeyRangeCache>(MockBehavior.Strict, null, null, null);
Mock<PartitionKeyRangeCache> mockPartitionKeyRangeCache = new Mock<PartitionKeyRangeCache>(MockBehavior.Strict, null, null, null, null);
mockPartitionKeyRangeCache.Setup(x => x.TryGetPartitionKeyRangeByIdAsync(
containerProperties.ResourceId,
partitionKeyRangeId,
Expand Down Expand Up @@ -473,7 +473,7 @@ await GatewayStoreModel.ApplySessionTokenAsync(
dsrSprocExecute,
ConsistencyLevel.Session,
new Mock<ISessionContainer>().Object,
partitionKeyRangeCache: new Mock<PartitionKeyRangeCache>(null, null, null).Object,
partitionKeyRangeCache: new Mock<PartitionKeyRangeCache>(null, null, null, null).Object,
clientCollectionCache: new Mock<ClientCollectionCache>(new SessionContainer("testhost"), gatewayStoreModel, null, null, null).Object,
globalEndpointManager: Mock.Of<IGlobalEndpointManager>());

Expand Down Expand Up @@ -512,7 +512,7 @@ await GatewayStoreModel.ApplySessionTokenAsync(
dsrNoSessionToken,
ConsistencyLevel.Session,
sessionContainer,
partitionKeyRangeCache: new Mock<PartitionKeyRangeCache>(null, null, null).Object,
partitionKeyRangeCache: new Mock<PartitionKeyRangeCache>(null, null, null, null).Object,
clientCollectionCache: new Mock<ClientCollectionCache>(new SessionContainer("testhost"), gatewayStoreModel, null, null, null).Object,
globalEndpointManager: globalEndpointManager.Object);

Expand Down Expand Up @@ -972,7 +972,7 @@ public async Task GatewayStoreModel_AvoidGlobalSessionToken()
null,
MockCosmosUtil.CreateCosmosHttpClient(() => new HttpClient()));
Mock<ClientCollectionCache> clientCollectionCache = new Mock<ClientCollectionCache>(new SessionContainer("testhost"), storeModel, null, null, null);
Mock<PartitionKeyRangeCache> partitionKeyRangeCache = new Mock<PartitionKeyRangeCache>(null, storeModel, clientCollectionCache.Object);
Mock<PartitionKeyRangeCache> partitionKeyRangeCache = new Mock<PartitionKeyRangeCache>(null, storeModel, clientCollectionCache.Object, endpointManager);

sessionContainer.SetSessionToken(
ResourceId.NewDocumentCollectionId(42, 129).DocumentCollectionId.ToString(),
Expand Down Expand Up @@ -1068,7 +1068,7 @@ Task<HttpResponseMessage> sendFunc(HttpRequestMessage request)

Mock<ClientCollectionCache> clientCollectionCache = new Mock<ClientCollectionCache>(new SessionContainer("testhost"), storeModel, null, null, null);

Mock<PartitionKeyRangeCache> partitionKeyRangeCache = new Mock<PartitionKeyRangeCache>(null, storeModel, clientCollectionCache.Object);
Mock<PartitionKeyRangeCache> partitionKeyRangeCache = new Mock<PartitionKeyRangeCache>(null, storeModel, clientCollectionCache.Object, endpointManager);
storeModel.SetCaches(partitionKeyRangeCache.Object, clientCollectionCache.Object);

INameValueCollection headers = new RequestNameValueCollection();
Expand Down Expand Up @@ -1136,7 +1136,7 @@ await GatewayStoreModel.ApplySessionTokenAsync(
documentServiceRequestToChild,
ConsistencyLevel.Session,
sessionContainer,
partitionKeyRangeCache: new Mock<PartitionKeyRangeCache>(null, null, null).Object,
partitionKeyRangeCache: new Mock<PartitionKeyRangeCache>(null, null, null, null).Object,
clientCollectionCache: new Mock<ClientCollectionCache>(sessionContainer, gatewayStoreModel, null, null, null).Object,
globalEndpointManager: globalEndpointManager.Object);

Expand Down Expand Up @@ -1202,7 +1202,7 @@ await GatewayStoreModel.ApplySessionTokenAsync(
documentServiceRequestToChild,
ConsistencyLevel.Session,
sessionContainer,
partitionKeyRangeCache: new Mock<PartitionKeyRangeCache>(null, null, null).Object,
partitionKeyRangeCache: new Mock<PartitionKeyRangeCache>(null, null, null, null).Object,
clientCollectionCache: new Mock<ClientCollectionCache>(sessionContainer, gatewayStoreModel, null, null, null).Object,
globalEndpointManager: globalEndpointManager.Object);

Expand Down Expand Up @@ -1273,7 +1273,7 @@ static async Task<HttpResponseMessage> messageHandler(HttpRequestMessage request
MockCosmosUtil.CreateCosmosHttpClient(() => new HttpClient(httpMessageHandler)));

ClientCollectionCache clientCollectionCache = new Mock<ClientCollectionCache>(new SessionContainer("testhost"), storeModel, null, null, null).Object;
PartitionKeyRangeCache partitionKeyRangeCache = new Mock<PartitionKeyRangeCache>(null, storeModel, clientCollectionCache).Object;
PartitionKeyRangeCache partitionKeyRangeCache = new Mock<PartitionKeyRangeCache>(null, storeModel, clientCollectionCache, endpointManager).Object;
storeModel.SetCaches(partitionKeyRangeCache, clientCollectionCache);

await executeWithGatewayStoreModel(storeModel);
Expand Down