Skip to content

Commit

Permalink
Enable connection state listener by default (#28471)
Browse files Browse the repository at this point in the history
* enable throughput control by default


Co-authored-by: annie-mac <annie-mac@XBX-2505-B09E.redmond.corp.microsoft.com>
Co-authored-by: annie-mac <annie-mac@yindeng2019.fareast.corp.microsoft.com>
Co-authored-by: annie-mac <annie-mac@annie-macs-MacBook-Pro.local>
  • Loading branch information
4 people committed May 18, 2022
1 parent 93a6145 commit 6507bf4
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions sdk/cosmos/azure-cosmos-spark_3-1_2-12/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#### Other Changes
* Changed 429 (Throttling) retry policy to have an upper bound for the back-off time of 5 seconds - See [PR 28764](https://github.com/Azure/azure-sdk-for-java/pull/28764)
* Improved efficiency of spark partitioning for queries with partitioning strategy `Restrictive` by skipping I/O calls to retrieve metadata (min. LSN, max. LSN, document count and total document size). - See [PR 28764](https://github.com/Azure/azure-sdk-for-java/pull/28764)
* Enable `connectionEndpointRediscoveryEnabled` by default - See [PR 28471](https://github.com/Azure/azure-sdk-for-java/pull/28471)

### 4.9.0 (2022-04-22)

Expand Down
3 changes: 2 additions & 1 deletion sdk/cosmos/azure-cosmos-spark_3-2_2-12/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
#### Other Changes
* Changed 429 (Throttling) retry policy to have an upper bound for the back-off time of 5 seconds - See [PR 28764](https://github.com/Azure/azure-sdk-for-java/pull/28764)
* Improved efficiency of spark partitioning for queries with partitioning strategy `Restrictive` by skipping I/O calls to retrieve metadata (min. LSN, max. LSN, document count and total document size). - See [PR 28764](https://github.com/Azure/azure-sdk-for-java/pull/28764)

* Enable `connectionEndpointRediscoveryEnabled` by default - See [PR 28471](https://github.com/Azure/azure-sdk-for-java/pull/28471)
*
### 4.9.0 (2022-04-22)

#### Bugs Fixed
Expand Down
1 change: 1 addition & 0 deletions sdk/cosmos/azure-cosmos/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* Improved performance of `query plan` cache by using `ConcurrentHashMap` with a fixed size of 1000 - See [PR 28537](https://github.com/Azure/azure-sdk-for-java/pull/28537)
* Changed 429 (Throttling) retry policy to have an upper bound for the back-off time of 5 seconds - See [PR 28764](https://github.com/Azure/azure-sdk-for-java/pull/28764)
* Improved `openConnectionsAndInitCaches` by using rntbd context negotiation. - See [PR 28470](https://github.com/Azure/azure-sdk-for-java/pull/28470)
* Enable `connectionEndpointRediscoveryEnabled` by default - See [PR 28471](https://github.com/Azure/azure-sdk-for-java/pull/28471)

### 4.29.1 (2022-04-27)
#### Bugs Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
public final class DirectConnectionConfig {
// Constants
private static final Boolean DEFAULT_CONNECTION_ENDPOINT_REDISCOVERY_ENABLED = false;
private static final Boolean DEFAULT_CONNECTION_ENDPOINT_REDISCOVERY_ENABLED = true;
private static final Duration DEFAULT_IDLE_ENDPOINT_TIMEOUT = Duration.ofHours(1l);
private static final Duration DEFAULT_CONNECT_TIMEOUT = Duration.ofSeconds(5L);
private static final Duration DEFAULT_NETWORK_REQUEST_TIMEOUT = Duration.ofSeconds(5L);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -856,9 +856,7 @@ public void rntbdStatistics(boolean connectionStateListenerEnabled) throws Excep
try {

DirectConnectionConfig connectionConfig = DirectConnectionConfig.getDefaultConfig();
if (connectionStateListenerEnabled) {
connectionConfig.setConnectionEndpointRediscoveryEnabled(true);
}
connectionConfig.setConnectionEndpointRediscoveryEnabled(connectionStateListenerEnabled);

client1 = new CosmosClientBuilder()
.endpoint(TestConfigurations.HOST)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void rntbd() throws Exception {
assertThat(objectNode.get("machineId").asText()).isEqualTo(machineId);
assertThat(objectNode.get("numberOfClients").asInt()).isEqualTo(2);
assertThat(objectNode.get("consistencyCfg").asText()).isEqualTo("(consistency: null, mm: false, prgns: [null])");
assertThat(objectNode.get("connCfg").get("rntbd").asText()).isEqualTo("(cto:PT5S, nrto:PT5S, icto:PT0S, ieto:PT1H, mcpe:130, mrpc:30, cer:false)");
assertThat(objectNode.get("connCfg").get("rntbd").asText()).isEqualTo("(cto:PT5S, nrto:PT5S, icto:PT0S, ieto:PT1H, mcpe:130, mrpc:30, cer:true)");
assertThat(objectNode.get("connCfg").get("gw").asText()).isEqualTo("(cps:null, nrto:null, icto:null, p:false)");
assertThat(objectNode.get("connCfg").get("other").asText()).isEqualTo("(ed: false, cs: false)");

Expand Down

0 comments on commit 6507bf4

Please sign in to comment.