kfaraz opened a new pull request, #19177:
URL: https://github.com/apache/druid/pull/19177

   ### Description
   
   
`KinesisFaultToleranceTest.test_supervisorRecovers_afterChangeInTopicPartitions()`
 has been flaky due to discrepancy in the number of records ingested:
   
   <details>
   
   <summary>Failure report</summary>
   ```java
   <testcase name="test_supervisorRecovers_afterChangeInTopicPartitions" 
classname="org.apache.druid.testing.embedded.kinesis.KinesisFaultToleranceTest" 
time="25.405">
       <failure message="expected: &lt;2000&gt; but was: &lt;2092&gt;" 
type="org.opentest4j.AssertionFailedError"><![CDATA[org.opentest4j.AssertionFailedError:
 expected: <2000
   > but was: <2092>
           at 
org.apache.druid.testing.embedded.indexing.StreamIndexTestBase.waitUntilPublishedRecordsAreIngested(StreamIndexTestBase.java:148)
           at 
org.apache.druid.testing.embedded.indexing.StreamIndexFaultToleranceTest.verifyAndTearDown(StreamIndexFaultToleranceTest.java:64)
           at java.base/java.lang.reflect.Method.invoke(Method.java:565)
           at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
           at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
   ]]></failure>
       <system-out><![CDATA[2026-03-18T06:13:50,126 INFO 
[HttpRemoteTaskRunner-worker-sync-3] 
org.apache.druid.indexing.overlord.hrtr.HttpRemoteTaskRunner - 
Worker[10.10.200.2
   09:8091] completed 
task[index_kinesis_datasource_hneafbpc_08bbfa356e4ee10_ifffdfao] with 
status[FAILED]
   2026-03-18T06:13:50,126 INFO [HttpRemoteTaskRunner-worker-sync-3] 
org.apache.druid.indexing.overlord.TaskQueue - Received status[FAILED] for 
task[index_kinesis_datasource_h
   neafbpc_08bbfa356e4ee10_ifffdfao].
   2026-03-18T06:13:50,126 INFO [TaskQueue-OnComplete-4] 
org.apache.druid.indexing.overlord.MetadataTaskStorage - Updating status of 
task [index_kinesis_datasource_hneafbpc_08
   bbfa356e4ee10_ifffdfao] to 
[TaskStatus{id=index_kinesis_datasource_hneafbpc_08bbfa356e4ee10_ifffdfao, 
status=FAILED, duration=23, errorMsg=org.apache.druid.indexing.seekabl
   estream.common.StreamException: 
software.amazon.awssdk.services.kinesis.model.ResourceInUseException: Stream 
arn:aws:kinesis:us-east-1:000000000000:stream/topic_datasource_
   hneafbpc is not currently ACTIVE or UPDATING. (Service: Kinesis, Status 
Code: 400, Request ID: b148c33e-2dc2-4a23-9e67-bdc5ff28445e) (SDK Attempt 
Count: 1)
           at 
org.apache.druid.indexing.kinesis.KinesisRecordSupplier.wrapExceptions(KinesisRecordSupplier.java:123)
           at org.apache.druid.indexing.kinesis.Kinesi...27 characters 
omitted....common.RetryUtils.retry(RetryUtils.java:129)
           at 
org.apache.druid.java.util.common.RetryUtils.retry(RetryUtils.java:81)
           at 
org.apache.druid.java.util.common.RetryUtils.retry(RetryUtils.java:163)
           at 
org.apache.druid.java.util.common.RetryUtils.retry(RetryUtils.java:153)
           at 
org.apache.druid.indexing.kinesis.KinesisRecordSupplier.lambda$isOffsetAvailable$0(KinesisRecordSupplier.java:705)
           at 
org.apache.druid.indexing.kinesis.KinesisRecordSupplier.wrapExceptions(KinesisRecordSupplier.java:120)
           ... 15 more
   }].
   ```
   
   </details>
   
   The root cause seems to be the failure of tasks that were running while the 
change in partition count was in progress.
   Since these tasks fail, some records are re-ingested by the supervisor 
thereby increasing the number of times the metric `ingest/events/processed` is 
emitted.
   
   As such, this metric by itself is not a reliable source to ensure that the 
expected number of records has been ingested successfully.
   
   Perhaps we could add another metric that is emitted by the supervisor which 
indicates the number of events ingested by a successful task. (Looking into 
this...)
   
   ### Changes
   
   <hr>
   
   This PR has:
   
   - [ ] been self-reviewed.
      - [ ] using the [concurrency 
checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md)
 (Remove this item if the PR doesn't have any relation to concurrency.)
   - [ ] added documentation for new or modified features or behaviors.
   - [ ] a release note entry in the PR description.
   - [ ] added Javadocs for most classes and all non-trivial methods. Linked 
related entities via Javadoc links.
   - [ ] added or updated version, license, or notice information in 
[licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
   - [ ] added comments explaining the "why" and the intent of the code 
wherever would not be obvious for an unfamiliar reader.
   - [ ] added unit tests or modified existing tests to cover new code paths, 
ensuring the threshold for [code 
coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
 is met.
   - [ ] added integration tests.
   - [ ] been tested in a test Druid cluster.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to