Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLINK-29395][Connector/Kinesis] Handle empty deaggregated records in… #21002

Merged

Conversation

hlteoh37
Copy link
Contributor

…FanOutRecordPublisher

What is the purpose of the change

Cherry-pick of https://github.com/apache/flink/pull/20945/files

The consumer fails when three conditions are met:

  1. Kinesis EFO record publisher uses an AT_TIMESTAMP starting position.
  2. The first record batch is not empty.
  3. The deaggregated record batch is empty.

This can happen when the user writes aggregated records into their Kinesis stream whilst specifying the explicitHashKey for every single user record. When resharding occurs, there is a possibility that records within the same aggregated batch fall into two different shards, since they have different explicit hash keys. When this happens, the deaggregated records are dropped. (We need to do this in Kinesis Consumer so we do not process duplicate records. See awslabs/kinesis-aggregation#11)

If all deaggregated records are dropped, the consumer receives an empty deaggregated record batch even though the record batch is not empty.

Brief change log

This is fixed by returning the AT_TIMESTAMP starting position when receiving an AT_TIMESTAMP sentinel sequence number.

Verifying this change

  • Unit tests

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? not applicable

@flinkbot
Copy link
Collaborator

flinkbot commented Oct 10, 2022

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@hlteoh37 hlteoh37 force-pushed the feature/kinesis_timestamp_fix_1_15 branch from 39d1566 to e96b27f Compare October 10, 2022 10:08
@dannycranmer dannycranmer merged commit ae20e52 into apache:release-1.15 Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants