From 793e0cda980505776b94eae4a7618ee23c08a583 Mon Sep 17 00:00:00 2001 From: Igor Bernstein Date: Fri, 19 Jul 2019 18:38:05 -0400 Subject: [PATCH 1/4] Bigtable: update retry & timeout settings Regenerate the client using the updated gapic settings: https://github.com/googleapis/googleapis/commit/184ab77f4cee62332f8f9a689c70c9bea441f836 And the updated gapic-generator: https://github.com/googleapis/gapic-generator/pull/2878 Update the javadocs for the new settings Re-enable the dropRowRange integration test now that the settings are correct --- .../BigtableInstanceAdminStubSettings.java | 96 +++++++++++-------- .../stub/BigtableTableAdminStubSettings.java | 85 +++++++++++----- .../data/v2/stub/BigtableStubSettings.java | 48 +++++++--- .../v2/stub/EnhancedBigtableStubSettings.java | 75 ++++++++------- .../v2/it/BigtableTableAdminClientIT.java | 2 - .../google-cloud-bigtable/synth.metadata | 10 +- synth.metadata | 3 + 7 files changed, 203 insertions(+), 116 deletions(-) create mode 100644 synth.metadata diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableInstanceAdminStubSettings.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableInstanceAdminStubSettings.java index 07bab404ad22..916ab00e7306 100644 --- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableInstanceAdminStubSettings.java +++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableInstanceAdminStubSettings.java @@ -503,9 +503,7 @@ public static class Builder ImmutableSet.copyOf( Lists.newArrayList( StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); - definitions.put( - "non_idempotent", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -516,7 +514,7 @@ public static class Builder RetrySettings settings = null; settings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(5L)) + .setInitialRetryDelay(Duration.ofMillis(1000L)) .setRetryDelayMultiplier(2.0) .setMaxRetryDelay(Duration.ofMillis(60000L)) .setInitialRpcTimeout(Duration.ofMillis(60000L)) @@ -524,7 +522,29 @@ public static class Builder .setMaxRpcTimeout(Duration.ofMillis(60000L)) .setTotalTimeout(Duration.ofMillis(600000L)) .build(); - definitions.put("default", settings); + definitions.put("idempotent_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(0L)) + .setRetryDelayMultiplier(1.0) + .setMaxRetryDelay(Duration.ofMillis(0L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("non_idempotent_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(0L)) + .setRetryDelayMultiplier(1.0) + .setMaxRetryDelay(Duration.ofMillis(0L)) + .setInitialRpcTimeout(Duration.ofMillis(300000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(300000L)) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build(); + definitions.put("non_idempotent_heavy_params", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); } @@ -619,99 +639,99 @@ private static Builder initDefaults(Builder builder) { builder .createInstanceSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("non_idempotent_heavy_params")); builder .getInstanceSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("idempotent_params")); builder .listInstancesSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("idempotent_params")); builder .partialUpdateInstanceSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("idempotent_params")); builder .deleteInstanceSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("non_idempotent_params")); builder .createClusterSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("non_idempotent_params")); builder .getClusterSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("idempotent_params")); builder .listClustersSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("idempotent_params")); builder .updateClusterSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("idempotent_params")); builder .deleteClusterSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("non_idempotent_params")); builder .createAppProfileSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("non_idempotent_params")); builder .getAppProfileSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("idempotent_params")); builder .listAppProfilesSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("idempotent_params")); builder .updateAppProfileSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("idempotent_params")); builder .deleteAppProfileSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("non_idempotent_params")); builder .getIamPolicySettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("idempotent_params")); builder .setIamPolicySettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("non_idempotent_params")); builder .testIamPermissionsSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("idempotent_params")); builder .createInstanceOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("non_idempotent_heavy_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) @@ -726,7 +746,7 @@ private static Builder initDefaults(Builder builder) { .setInitialRpcTimeout(Duration.ZERO) // ignored .setRpcTimeoutMultiplier(1.0) // ignored .setMaxRpcTimeout(Duration.ZERO) // ignored - .setTotalTimeout(Duration.ofMillis(300000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) .build())); builder .partialUpdateInstanceOperationSettings() @@ -734,7 +754,7 @@ private static Builder initDefaults(Builder builder) { UnaryCallSettings .newUnaryCallSettingsBuilder() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("idempotent_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) @@ -749,15 +769,15 @@ private static Builder initDefaults(Builder builder) { .setInitialRpcTimeout(Duration.ZERO) // ignored .setRpcTimeoutMultiplier(1.0) // ignored .setMaxRpcTimeout(Duration.ZERO) // ignored - .setTotalTimeout(Duration.ofMillis(300000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) .build())); builder .createClusterOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("non_idempotent_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Cluster.class)) @@ -766,20 +786,20 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setMaxRetryDelay(Duration.ofMillis(60000L)) .setInitialRpcTimeout(Duration.ZERO) // ignored .setRpcTimeoutMultiplier(1.0) // ignored .setMaxRpcTimeout(Duration.ZERO) // ignored - .setTotalTimeout(Duration.ofMillis(300000L)) + .setTotalTimeout(Duration.ofMillis(21600000L)) .build())); builder .updateClusterOperationSettings() .setInitialCallSettings( UnaryCallSettings.newUnaryCallSettingsBuilder() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("idempotent_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Cluster.class)) @@ -794,7 +814,7 @@ private static Builder initDefaults(Builder builder) { .setInitialRpcTimeout(Duration.ZERO) // ignored .setRpcTimeoutMultiplier(1.0) // ignored .setMaxRpcTimeout(Duration.ZERO) // ignored - .setTotalTimeout(Duration.ofMillis(300000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) .build())); builder .updateAppProfileOperationSettings() @@ -802,7 +822,7 @@ private static Builder initDefaults(Builder builder) { UnaryCallSettings .newUnaryCallSettingsBuilder() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("idempotent_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(AppProfile.class)) @@ -811,13 +831,13 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(5L)) + .setInitialRetryDelay(Duration.ofMillis(500L)) .setRetryDelayMultiplier(1.5) .setMaxRetryDelay(Duration.ofMillis(5000L)) .setInitialRpcTimeout(Duration.ZERO) // ignored .setRpcTimeoutMultiplier(1.0) // ignored .setMaxRpcTimeout(Duration.ZERO) // ignored - .setTotalTimeout(Duration.ofMillis(300000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) .build())); return builder; diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableTableAdminStubSettings.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableTableAdminStubSettings.java index 077edc38a09e..d0584914100e 100644 --- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableTableAdminStubSettings.java +++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableTableAdminStubSettings.java @@ -479,15 +479,48 @@ public static class Builder RetrySettings settings = null; settings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(1.3) + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(2.0) .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) .setTotalTimeout(Duration.ofMillis(600000L)) .build(); - definitions.put("default", settings); + definitions.put("idempotent_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(0L)) + .setRetryDelayMultiplier(1.0) + .setMaxRetryDelay(Duration.ofMillis(0L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("non_idempotent_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(0L)) + .setRetryDelayMultiplier(1.0) + .setMaxRetryDelay(Duration.ofMillis(0L)) + .setInitialRpcTimeout(Duration.ofMillis(300000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(300000L)) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build(); + definitions.put("non_idempotent_heavy_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(0L)) + .setRetryDelayMultiplier(1.0) + .setMaxRetryDelay(Duration.ofMillis(0L)) + .setInitialRpcTimeout(Duration.ofMillis(3600000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(3600000L)) + .setTotalTimeout(Duration.ofMillis(3600000L)) + .build(); + definitions.put("drop_row_range_params", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); } @@ -561,74 +594,74 @@ private static Builder initDefaults(Builder builder) { builder .createTableSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("non_idempotent_heavy_params")); builder .createTableFromSnapshotSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("non_idempotent_params")); builder .listTablesSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("idempotent_params")); builder .getTableSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("idempotent_params")); builder .deleteTableSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("non_idempotent_params")); builder .modifyColumnFamiliesSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("non_idempotent_heavy_params")); builder .dropRowRangeSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("drop_row_range_params")); builder .generateConsistencyTokenSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("idempotent_params")); builder .checkConsistencySettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("idempotent_params")); builder .snapshotTableSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("non_idempotent_params")); builder .getSnapshotSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("idempotent_params")); builder .listSnapshotsSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("idempotent_params")); builder .deleteSnapshotSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("non_idempotent_params")); builder .createTableFromSnapshotOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("non_idempotent_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Table.class)) @@ -638,21 +671,21 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setMaxRetryDelay(Duration.ofMillis(60000L)) .setInitialRpcTimeout(Duration.ZERO) // ignored .setRpcTimeoutMultiplier(1.0) // ignored .setMaxRpcTimeout(Duration.ZERO) // ignored - .setTotalTimeout(Duration.ofMillis(300000L)) + .setTotalTimeout(Duration.ofMillis(3600000L)) .build())); builder .snapshotTableOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("non_idempotent_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Snapshot.class)) @@ -667,7 +700,7 @@ private static Builder initDefaults(Builder builder) { .setInitialRpcTimeout(Duration.ZERO) // ignored .setRpcTimeoutMultiplier(1.0) // ignored .setMaxRpcTimeout(Duration.ZERO) // ignored - .setTotalTimeout(Duration.ofMillis(300000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) .build())); return builder; diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java index 905e6d1012d6..4299f0154f3d 100644 --- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java +++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java @@ -226,26 +226,48 @@ public static class Builder extends StubSettings.Builder DEFAULT_RETRY_CODES = - ImmutableSet.of(Code.DEADLINE_EXCEEDED, Code.UNAVAILABLE, Code.ABORTED); + private static final Set IDEMPOTENT_RETRY_CODES = + ImmutableSet.of(Code.DEADLINE_EXCEEDED, Code.UNAVAILABLE); // Copy of default retrying settings in the yaml - private static final RetrySettings DEFAULT_RETRY_SETTINGS = + private static final RetrySettings IDEMPOTENT_RETRY_SETTINGS = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setInitialRetryDelay(Duration.ofMillis(10)) + .setRetryDelayMultiplier(2) + .setMaxRetryDelay(Duration.ofMinutes(1)) + .setInitialRpcTimeout(Duration.ofSeconds(20)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(20000L)) - .setTotalTimeout(Duration.ofMillis(600000L)) + .setMaxRpcTimeout(Duration.ofSeconds(20)) + .setTotalTimeout(Duration.ofMinutes(10)) + .build(); + + private static final RetrySettings MUTATE_ROWS_RETRY_SETTINGS = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(10)) + .setRetryDelayMultiplier(2) + .setMaxRetryDelay(Duration.ofMinutes(1)) + .setInitialRpcTimeout(Duration.ofMinutes(1)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMinutes(1)) + .setTotalTimeout(Duration.ofMinutes(10)) .build(); /** @@ -202,12 +213,12 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde *
  • Retry {@link ServerStreamingCallSettings.Builder#setRetryableCodes error codes} are: * {@link Code#DEADLINE_EXCEEDED} and {@link Code#UNAVAILABLE}. *
  • RetryDelay between failed attempts {@link RetrySettings.Builder#setInitialRetryDelay - * starts} at 100ms and {@link RetrySettings.Builder#setRetryDelayMultiplier increases - * exponentially} by a factor of 1.3 until a {@link RetrySettings.Builder#setMaxRetryDelay - * maximum of} 60 seconds. + * starts} at 10ms and {@link RetrySettings.Builder#setRetryDelayMultiplier increases + * exponentially} by a factor of 2 until a {@link RetrySettings.Builder#setMaxRetryDelay + * maximum of} 1 minute. *
  • The default read timeout for {@link RetrySettings.Builder#setMaxRpcTimeout each row} in a - * response stream is 20 seconds and the timeout to read the {@link - * RetrySettings.Builder#setTotalTimeout entire stream} is 1 hour. + * response stream is 5 minutes and the timeout to read the {@link + * RetrySettings.Builder#setTotalTimeout entire stream} is 12 hours. * */ public ServerStreamingCallSettings readRowsSettings() { @@ -225,9 +236,9 @@ public ServerStreamingCallSettings readRowsSettings() { *
  • Retry {@link UnaryCallSettings.Builder#setRetryableCodes error codes} are: {@link * Code#DEADLINE_EXCEEDED} and {@link Code#UNAVAILABLE}. *
  • RetryDelay between failed attempts {@link RetrySettings.Builder#setInitialRetryDelay - * starts} at 100ms and {@link RetrySettings.Builder#setRetryDelayMultiplier increases - * exponentially} by a factor of 1.3 until a {@link RetrySettings.Builder#setMaxRetryDelay - * maximum of} 60 seconds. + * starts} at 10ms and {@link RetrySettings.Builder#setRetryDelayMultiplier increases + * exponentially} by a factor of 2 until a {@link RetrySettings.Builder#setMaxRetryDelay + * maximum of} 1 minute. *
  • The default timeout for {@link RetrySettings.Builder#setMaxRpcTimeout each attempt} is 20 * seconds and the timeout for the {@link RetrySettings.Builder#setTotalTimeout entire * operation} across all of the attempts is 10 mins. @@ -248,9 +259,9 @@ public UnaryCallSettings> sampleRowKeysSettings() { *
  • Retry {@link UnaryCallSettings.Builder#setRetryableCodes error codes} are: {@link * Code#DEADLINE_EXCEEDED} and {@link Code#UNAVAILABLE}. *
  • RetryDelay between failed attempts {@link RetrySettings.Builder#setInitialRetryDelay - * starts} at 100ms and {@link RetrySettings.Builder#setRetryDelayMultiplier increases - * exponentially} by a factor of 1.3 until a {@link RetrySettings.Builder#setMaxRetryDelay - * maximum of} 60 seconds. + * starts} at 10ms and {@link RetrySettings.Builder#setRetryDelayMultiplier increases + * exponentially} by a factor of 2 until a {@link RetrySettings.Builder#setMaxRetryDelay + * maximum of} 1 minute. *
  • The default timeout for {@link RetrySettings.Builder#setMaxRpcTimeout each attempt} is 20 * seconds and the timeout for the {@link RetrySettings.Builder#setTotalTimeout entire * operation} across all of the attempts is 10 mins. @@ -273,8 +284,8 @@ public UnaryCallSettings readRowSettings() { *
  • Retry {@link UnaryCallSettings.Builder#setRetryableCodes error codes} are: {@link * Code#DEADLINE_EXCEEDED} and {@link Code#UNAVAILABLE}. *
  • RetryDelay between failed attempts {@link RetrySettings.Builder#setInitialRetryDelay - * starts} at 100ms and {@link RetrySettings.Builder#setRetryDelayMultiplier increases - * exponentially} by a factor of 1.3 until a {@link RetrySettings.Builder#setMaxRetryDelay + * starts} at 10ms and {@link RetrySettings.Builder#setRetryDelayMultiplier increases + * exponentially} by a factor of 2 until a {@link RetrySettings.Builder#setMaxRetryDelay * maximum of} 60 seconds. *
  • The default timeout for {@link RetrySettings.Builder#setMaxRpcTimeout each attempt} is 20 * seconds and the timeout for the {@link RetrySettings.Builder#setTotalTimeout entire @@ -300,11 +311,11 @@ public UnaryCallSettings mutateRowSettings() { *
  • Retry {@link UnaryCallSettings.Builder#setRetryableCodes error codes} are: {@link * Code#DEADLINE_EXCEEDED}, {@link Code#UNAVAILABLE} and {@link Code#ABORTED}. *
  • RetryDelay between failed attempts {@link RetrySettings.Builder#setInitialRetryDelay - * starts} at 100ms and {@link RetrySettings.Builder#setRetryDelayMultiplier increases - * exponentially} by a factor of 1.3 until a {@link RetrySettings.Builder#setMaxRetryDelay - * maximum of} 60 seconds. - *
  • The default timeout for {@link RetrySettings.Builder#setMaxRpcTimeout each attempt} is 20 - * seconds and the timeout for the {@link RetrySettings.Builder#setTotalTimeout entire + * starts} at 10ms and {@link RetrySettings.Builder#setRetryDelayMultiplier increases + * exponentially} by a factor of 2 until a {@link RetrySettings.Builder#setMaxRetryDelay + * maximum of} 1 minute. + *
  • The default timeout for {@link RetrySettings.Builder#setMaxRpcTimeout each attempt} is 1 + * minute and the timeout for the {@link RetrySettings.Builder#setTotalTimeout entire * operation} across all of the attempts is 10 mins. * * @@ -340,7 +351,7 @@ public BatchingCallSettings bulkMutateRowsSettings() { *

    This is a non-idempotent and non-streaming operation. * *

    By default this operation does not reattempt in case of RPC failure. The default timeout for - * the {@link RetrySettings.Builder#setTotalTimeout entire operation} is 10 mins. + * the {@link RetrySettings.Builder#setTotalTimeout entire operation} is 20 seconds. * * @see RetrySettings for more explanation. */ @@ -354,7 +365,7 @@ public UnaryCallSettings checkAndMutateRowSetti *

    This is a non-idempotent and non-streaming operation. * *

    By default this operation does not reattempt in case of RPC failure. The default timeout for - * the {@link RetrySettings.Builder#setTotalTimeout entire operation} is 10 mins. + * the {@link RetrySettings.Builder#setTotalTimeout entire operation} is 20 seconds. * * @see RetrySettings for more explanation. */ @@ -426,7 +437,7 @@ private Builder() { .readRowsSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(DEFAULT_RETRY_SETTINGS.getTotalTimeout()) + .setTotalTimeout(IDEMPOTENT_RETRY_SETTINGS.getTotalTimeout()) .build()); sampleRowKeysSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); @@ -439,8 +450,8 @@ private Builder() { bulkMutateRowsSettings = BatchingCallSettings.newBuilder(new PlaceholderBatchingDescriptor()) - .setRetryableCodes(DEFAULT_RETRY_CODES) - .setRetrySettings(DEFAULT_RETRY_SETTINGS) + .setRetryableCodes(IDEMPOTENT_RETRY_CODES) + .setRetrySettings(MUTATE_ROWS_RETRY_SETTINGS) .setBatchingSettings( BatchingSettings.newBuilder() .setIsEnabled(true) diff --git a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableTableAdminClientIT.java b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableTableAdminClientIT.java index 4097f98ce870..8bafb888f9d7 100644 --- a/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableTableAdminClientIT.java +++ b/google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableTableAdminClientIT.java @@ -43,7 +43,6 @@ import org.junit.AssumptionViolatedException; import org.junit.Before; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Test; import org.threeten.bp.Duration; @@ -236,7 +235,6 @@ public void listTablesAsync() throws Exception { } } - @Ignore @Test public void dropRowRange() { String tableId = getTableId("adminDropRowrangeTest"); diff --git a/google-cloud-clients/google-cloud-bigtable/synth.metadata b/google-cloud-clients/google-cloud-bigtable/synth.metadata index 078f61cd8796..88bda175a762 100644 --- a/google-cloud-clients/google-cloud-bigtable/synth.metadata +++ b/google-cloud-clients/google-cloud-bigtable/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-05-07T07:36:07.852297Z", + "updateTime": "2019-07-19T22:37:31.368135Z", "sources": [ { "generator": { "name": "artman", - "version": "0.19.0", - "dockerImage": "googleapis/artman@sha256:d3df563538225ac6caac45d8ad86499500211d1bcb2536955a6dbda15e1b368e" + "version": "0.30.1", + "dockerImage": "googleapis/artman@sha256:f1a2e851e5e012c59e1da4125480bb19878f86a4e7fac4f375f2e819956b5aa3" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "5aeb4179d0c424be6b1b228bce7ec75ec24f3d12", - "internalRef": "246901187" + "sha": "184ab77f4cee62332f8f9a689c70c9bea441f836", + "internalRef": "259048326" } } ], diff --git a/synth.metadata b/synth.metadata new file mode 100644 index 000000000000..aac3df4648ca --- /dev/null +++ b/synth.metadata @@ -0,0 +1,3 @@ +{ + "updateTime": "2019-07-19T21:44:12.996068Z" +} \ No newline at end of file From 6f5d8f30260fb6ae6ed95db0cfb0995a57464119 Mon Sep 17 00:00:00 2001 From: Igor Bernstein Date: Fri, 19 Jul 2019 18:39:50 -0400 Subject: [PATCH 2/4] remove extra file --- .../google-cloud-bigtable/synth.metadata | 42 ------------------- 1 file changed, 42 deletions(-) delete mode 100644 google-cloud-clients/google-cloud-bigtable/synth.metadata diff --git a/google-cloud-clients/google-cloud-bigtable/synth.metadata b/google-cloud-clients/google-cloud-bigtable/synth.metadata deleted file mode 100644 index 88bda175a762..000000000000 --- a/google-cloud-clients/google-cloud-bigtable/synth.metadata +++ /dev/null @@ -1,42 +0,0 @@ -{ - "updateTime": "2019-07-19T22:37:31.368135Z", - "sources": [ - { - "generator": { - "name": "artman", - "version": "0.30.1", - "dockerImage": "googleapis/artman@sha256:f1a2e851e5e012c59e1da4125480bb19878f86a4e7fac4f375f2e819956b5aa3" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "184ab77f4cee62332f8f9a689c70c9bea441f836", - "internalRef": "259048326" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "bigtable", - "apiVersion": "v2", - "language": "java", - "generator": "gapic", - "config": "google/bigtable/artman_bigtable.yaml" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "bigtable-admin", - "apiVersion": "v2", - "language": "java", - "generator": "gapic", - "config": "google/bigtable/admin/artman_bigtableadmin.yaml" - } - } - ] -} \ No newline at end of file From c416c441c47ee44158e2bb5dfbc117d997993067 Mon Sep 17 00:00:00 2001 From: Igor Bernstein Date: Fri, 19 Jul 2019 18:40:37 -0400 Subject: [PATCH 3/4] Revert "remove extra file" This reverts commit 6f5d8f30260fb6ae6ed95db0cfb0995a57464119. --- .../google-cloud-bigtable/synth.metadata | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 google-cloud-clients/google-cloud-bigtable/synth.metadata diff --git a/google-cloud-clients/google-cloud-bigtable/synth.metadata b/google-cloud-clients/google-cloud-bigtable/synth.metadata new file mode 100644 index 000000000000..88bda175a762 --- /dev/null +++ b/google-cloud-clients/google-cloud-bigtable/synth.metadata @@ -0,0 +1,42 @@ +{ + "updateTime": "2019-07-19T22:37:31.368135Z", + "sources": [ + { + "generator": { + "name": "artman", + "version": "0.30.1", + "dockerImage": "googleapis/artman@sha256:f1a2e851e5e012c59e1da4125480bb19878f86a4e7fac4f375f2e819956b5aa3" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "184ab77f4cee62332f8f9a689c70c9bea441f836", + "internalRef": "259048326" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "bigtable", + "apiVersion": "v2", + "language": "java", + "generator": "gapic", + "config": "google/bigtable/artman_bigtable.yaml" + } + }, + { + "client": { + "source": "googleapis", + "apiName": "bigtable-admin", + "apiVersion": "v2", + "language": "java", + "generator": "gapic", + "config": "google/bigtable/admin/artman_bigtableadmin.yaml" + } + } + ] +} \ No newline at end of file From 4d804b27b95aa7606f678fee85513b2ca47211f6 Mon Sep 17 00:00:00 2001 From: Igor Bernstein Date: Fri, 19 Jul 2019 18:40:52 -0400 Subject: [PATCH 4/4] remove extra file --- synth.metadata | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 synth.metadata diff --git a/synth.metadata b/synth.metadata deleted file mode 100644 index aac3df4648ca..000000000000 --- a/synth.metadata +++ /dev/null @@ -1,3 +0,0 @@ -{ - "updateTime": "2019-07-19T21:44:12.996068Z" -} \ No newline at end of file