GitHub user tzulitai opened a pull request:
https://github.com/apache/flink/pull/2131
[FLINK-3231][streaming-connectors] FlinkKinesisConsumer rework to handle
Kinesis resharding
This change attempts to solve 2 issues:
1. [FLINK-3231](https://issues.apache.org/jira/browse/FLINK-3231): Handle
Kinesis-side resharding.
2. [FLINK-4020](https://issues.apache.org/jira/browse/FLINK-4020): Remove
shard list querying from Kinesis consumer constructor.
Some notes on the implementation:
- All subtasks has a thread that continuously polls for changes in the
Kinesis stream, and uses exponential backoff with jitter to try to even out the
concurrent Kinesis client describeStream operations across subtasks.
Continuously polling is necessary because there's currently no way to "signal"
a subtask that it has a new shard it should be subscribing to.
- A big change is that all subtasks run a fetcher that continues to poll
for shards, even if the subtask initially didn't have shards to consume
(before, a MAX_VALUE waterwark was sent out).
- Apart from the unit tests, I've manually tested this with
`ManualExactlyOnceWithStreamReshardingTest`. However, since the
`FlinkKinesisProducer` currently has some problem that records are resent when
Kinesis streams are resharded (thus not allowing the exactly-once test to pass
at all), this manual test uses a normal event generator instead of a producer
topology running the `FlinkKinesisProducer`.
Since this PR introduces considerable rework on the Kinesis consumer, I'll
wait until this is merged before submitting
[FLINK-4080](https://issues.apache.org/jira/browse/FLINK-4080) &
[FLINK-4019](https://issues.apache.org/jira/browse/FLINK-4019).
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/tzulitai/flink FLINK-3231
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/2131.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2131
----
commit 378ec8177f1bfe91b459233a8ce02e9f988c61ab
Author: Gordon Tai <[email protected]>
Date: 2016-06-08T10:46:02Z
[FLINK-4020] Move shard list querying to open() for Kinesis consumer
commit 2c9f1304d5f6220fe36ad9d7833a506651f3fee6
Author: Gordon Tai <[email protected]>
Date: 2016-06-19T16:15:43Z
[FLINK-3231] FlinkKinesisConsumer rework to handle Kinesis resharding
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---