Description
openedon Jul 7, 2023
Need some investigation to check whether the current behavior is by design.
Issue:
Request is being retried in unavailable region after marking the region unavailable. (This only happens for request in retry, does not happen for future requests)
Repro steps:
Database account region: A, B
PreferredRegionList: A, B
Simulate AddressRefresh connection timeout in region A
expected the request will be retried in B after SDK marking the region unavailable, but it retried in region A again before retry region B
Possible root cause:
When region is being marked as unavailable, SDK will move the region to the end of the region list, however at the same time, the retryCount/retryIndex will be increased on the request, which ends up picking the unavailable region again.
when request starts:
request(locationIndex=0), region(A, B) -> region at index 0 -> A
During retry:
request(locationIndex=1), region(B, A) -> region at index 1 -> A