New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing region fail over issue for direct tcp calls #351
Conversation
gateway/src/main/java/com/microsoft/azure/cosmosdb/rx/internal/ClientRetryPolicy.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have some questions.
.../main/java/com/microsoft/azure/cosmosdb/internal/directconnectivity/GatewayAddressCache.java
Show resolved
Hide resolved
gateway/src/main/java/com/microsoft/azure/cosmosdb/rx/internal/ClientRetryPolicy.java
Show resolved
Hide resolved
gateway/src/main/java/com/microsoft/azure/cosmosdb/rx/internal/ClientRetryPolicy.java
Show resolved
Hide resolved
sdk/src/test/java/com/microsoft/azure/cosmosdb/rx/CollectionCrudTest.java
Outdated
Show resolved
Hide resolved
Discussed the above comments with @simplynaveen20 offline. Good to go from my side. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have more comments. still reviewing in a sev1.
commons/src/main/java/com/microsoft/azure/cosmosdb/DocumentClientException.java
Outdated
Show resolved
Hide resolved
commons/src/main/java/com/microsoft/azure/cosmosdb/DocumentClientException.java
Outdated
Show resolved
Hide resolved
gateway/src/main/java/com/microsoft/azure/cosmosdb/rx/internal/ClientRetryPolicy.java
Outdated
Show resolved
Hide resolved
commons/src/main/java/com/microsoft/azure/cosmosdb/DocumentClientException.java
Outdated
Show resolved
Hide resolved
gateway/src/main/java/com/microsoft/azure/cosmosdb/rx/internal/ClientRetryPolicy.java
Outdated
Show resolved
Hide resolved
gateway/src/main/java/com/microsoft/azure/cosmosdb/rx/internal/ClientRetryPolicy.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me thanks Naveen.
Once scenario we haven't covered is when address resolution request to GW fails.
This will cause a region failover, but instead we should be more lenient toward GW address all and not fail over the region.
Yes as discussed , its not only address resolution, we need to think and change region fail over for all GW calls. |
@@ -323,6 +323,9 @@ | |||
|
|||
// 404: LSN in session token is higher | |||
public static final int READ_SESSION_NOT_AVAILABLE = 1002; | |||
|
|||
// Client generated gateway network error substatus | |||
public static final int GATEWAY_ENDPOINT_UNAVAILABLE = 10001; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should use a substatus code which doesn't collide with the service side substatus codes otherwise the client-retry-policy will be confused.
Currently for tcp network exception we are doing region failover, which is causing problem for some users where due to some intermittent network issue on BE nodes sdk is sending traffic for next 5 min to other available region.
This PR will limit the region failover only in case of http network failure.