You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by za...@apache.org on 2022/02/15 07:33:44 UTC

[druid] branch master updated: Increase retries for Kinesis sharding integration tests. (#12255)

This is an automated email from the ASF dual-hosted git repository.

zachjsh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git


The following commit(s) were added to refs/heads/master by this push:
     new 47153cd  Increase retries for Kinesis sharding integration tests. (#12255)
47153cd is described below

commit 47153cd7bd600135289062c009f6405a4c83f640
Author: Daniel Koepke <dk...@gmail.com>
AuthorDate: Mon Feb 14 23:33:13 2022 -0800

    Increase retries for Kinesis sharding integration tests. (#12255)
    
    This fixes intermittent, spurious failures that we've observed in
    the Kinesis sharding integration tests due to Kinesis taking
    longer than the code expected to start a sharding operation. The
    method that's changed is part of the integration test suite and
    only used by the test cases that we've seen are flaky.
    
    Prior to this change, the tests expected a sharding operation to
    start in 9 seconds (30 retries * 300ms delay/retry). This change
    bumps the number of retries to 100, giving Kinesis 30 seconds to
    start the sharding.
    
    This PR also makes a small, clarifying change to the condition
    used to determine if sharding has started. Instead of checking if
    the number of shards has increased (which was technically correct
    even if the test is reducing the number of shards due to a Kinesis
    implementation detail), we now just check if the shard count has
    changed.
---
 .../org/apache/druid/testing/utils/KinesisAdminClient.java     | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/integration-tests/src/main/java/org/apache/druid/testing/utils/KinesisAdminClient.java b/integration-tests/src/main/java/org/apache/druid/testing/utils/KinesisAdminClient.java
index 53e3284..d67f315 100644
--- a/integration-tests/src/main/java/org/apache/druid/testing/utils/KinesisAdminClient.java
+++ b/integration-tests/src/main/java/org/apache/druid/testing/utils/KinesisAdminClient.java
@@ -129,13 +129,15 @@ public class KinesisAdminClient implements StreamAdminClient
       ITRetryUtil.retryUntil(
           () -> {
             int updatedShardCount = getStreamPartitionCount(streamName);
-            // Stream should be in active or updating state AND
-            // the number of shards must have increased irrespective of the value of newShardCount
+
+            // Retry until Kinesis records the operation is either in progress (UPDATING) or completed (ACTIVE)
+            // and the shard count has changed.
+
             return verifyStreamStatus(streamName, StreamStatus.ACTIVE, StreamStatus.UPDATING)
-                   && updatedShardCount > originalShardCount;
+                   && updatedShardCount != originalShardCount;
           }, true,
           300, // higher value to avoid exceeding kinesis TPS limit
-          30,
+          100,
           "Kinesis stream resharding to start (or finished)"
       );
     }

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org