flink icon indicating copy to clipboard operation
flink copied to clipboard

[FLINK-29099][connectors/kinesis] Update global watermark for idle subtask

Open sethsaperstein-lyft opened this issue 3 years ago • 1 comments

What is the purpose of the change

This pull request updates the global watermark for subtasks marked idle, rather than waiting until the subtask is no longer idle. That way we avoid a deadlock state where the subtask is idle and unable to emit records due to lookahead.

Brief change log

  • The WatermarkSyncCallback is now able to get the global watermark without updating it
  • Additional debug logging while emitting the watermark

Verifying this change

Please make sure both new and modified tests in this PR follows the conventions defined in our code quality guide: https://flink.apache.org/contributing/code-style-and-quality-common.html#testing

This change added tests and can be verified as follows:

  • Updated tests to add getWatermark without modifying to watermark
  • Manually verified the change by running a 8 node cluster with 2 JobManagers and 8 TaskManagers. I manually introduced a sleep of the ShardConsumer thread for 10 minutes for subtask 0 after 5 minutes had passed. This forced the subtask into an idle state as the subtask was no longer receiving data from Kinesis. I verified the local and global watermarks were updated correctly via logs and metrics. When the subtask's ShardConsumer thread continued after the 10 minute sleep, it continued updating the global watermark as usual.

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

sethsaperstein-lyft avatar Sep 16 '22 02:09 sethsaperstein-lyft

CI report:

  • cd7268aed6bf01f2fb0ae779f4148af55a47ab3a UNKNOWN
  • 3db3cf486d83e1562444c8481199c0a5589f2045 Azure: SUCCESS
Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

flinkbot avatar Sep 16 '22 02:09 flinkbot

@flinkbot run azure

sethsaperstein-lyft avatar Sep 28 '22 07:09 sethsaperstein-lyft

@flinkbot run azure

sethsaperstein-lyft avatar Oct 04 '22 22:10 sethsaperstein-lyft

ptal @tweise

sethsaperstein-lyft avatar Oct 04 '22 22:10 sethsaperstein-lyft

@flinkbot run azure

sethsaperstein-lyft avatar Oct 31 '22 18:10 sethsaperstein-lyft

@sethsaperstein-lyft thanks, I will take a look in the next few days.

tweise avatar Oct 31 '22 18:10 tweise

@flinkbot run azure

sethsaperstein-lyft avatar Nov 01 '22 04:11 sethsaperstein-lyft

@flinkbot run azure

tweise avatar Nov 20 '22 18:11 tweise

@flinkbot run azure

sethsaperstein-lyft avatar Nov 27 '22 21:11 sethsaperstein-lyft

@flinkbot run azure

tweise avatar Nov 28 '22 14:11 tweise

Unrelated issue in docs_404_check:

2022-11-28T14:46:48.1952435Z go: downloading github.com/apache/flink-connector-elasticsearch v3.0.0+incompatible
2022-11-28T14:46:48.3168143Z go: module github.com/apache/flink-connector-elasticsearch@upgrade found (v3.0.0+incompatible), but does not contain package github.com/apache/flink-connector-elasticsearch/docs
2022-11-28T14:46:48.3207117Z go: no module dependencies to download
2022-11-28T14:46:48.3256517Z hugo: collected modules in 2814 ms
2022-11-28T14:46:48.3256853Z Total in 2815 ms
2022-11-28T14:46:48.3257824Z Error: module "github.com/apache/flink-connector-elasticsearch/docs" not found; either add it as a Hugo Module or store it in "/home/vsts/work/1/s/docs/themes".: module does not exist

tweise avatar Nov 28 '22 17:11 tweise

Unrelated error in test_connect_2 (Kafka connector):

Nov 28 15:09:24 [WARNING] The requested profile "skip-webui-build" could not be activated because it does not exist.
Nov 28 15:09:24 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test (integration-tests) on project flink-connector-kafka: There are test failures.
Nov 28 15:09:24 [ERROR] 
Nov 28 15:09:24 [ERROR] Please refer to /__w/3/s/flink-connectors/flink-connector-kafka/target/surefire-reports for the individual test results.
Nov 28 15:09:24 [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
Nov 28 15:09:24 [ERROR] -> [Help 1]
Nov 28 15:09:24 [ERROR] 
Nov 28 15:09:24 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
Nov 28 15:09:24 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
Nov 28 15:09:24 [ERROR] 
Nov 28 15:09:24 [ERROR] For more information about the errors and possible solutions, please read the following articles:
Nov 28 15:09:24 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Nov 28 15:09:24 [ERROR] 
Nov 28 15:09:24 [ERROR] After correcting the problems, you can resume the build with the command
Nov 28 15:09:24 [ERROR]   mvn <goals> -rf :flink-connector-kafka

tweise avatar Nov 28 '22 17:11 tweise

@sethsaperstein-lyft please rebase to latest master

tweise avatar Nov 28 '22 17:11 tweise

@flinkbot run azure

sethsaperstein-lyft avatar Nov 28 '22 17:11 sethsaperstein-lyft