Skip to content

Conversation

@Myracle
Copy link
Contributor

@Myracle Myracle commented May 10, 2023

What is the purpose of the change

Support negative Duration for special usage, such as -1ms for execution.buffer-timeout

Brief change log

  • Support to parse the negative sign in TimeUtils's method parseDuration.

Verifying this change

This change added tests and can be verified as follows:

  • Added test testParseDurationWithNegativeNumber in TimeUtilsTest.

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)

@flinkbot
Copy link
Collaborator

flinkbot commented May 10, 2023

CI report:

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

Copy link
Member

@1996fanrui 1996fanrui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Myracle , thanks for your contribution.

I see the CI fails, please run mvn spotless:apply before commiting.

@zentol
Copy link
Contributor

zentol commented May 10, 2023

Could we not do this? This now break assumptions that every other component can make in that configured durations are always positive.

Either use Configuration#getOptional (+ adding it by default to flink-conf.yaml) or add a boolean option to disable the timeout.

@Myracle
Copy link
Contributor Author

Myracle commented May 10, 2023

@zentol I agree with you for that the change may affect other usages. What about adding a boolean config named execution.buffer-timeout.enabled which default value is true. When it is false, flushing only when the output buffer is full. At the same time, the execution.buffer-timeout's value will be ignored. cc @1996fanrui

@1996fanrui
Copy link
Member

Thanks @zentol 's feedback here.

What about adding a boolean config named execution.buffer-timeout.enabled which default value is true. When it is false, flushing only when the output buffer is full. At the same time, the execution.buffer-timeout's value will be ignored.

Sounds make sense.

@Myracle Myracle force-pushed the FLINK-32023-support-negative-execution.buffer-timeout branch from 507ea2e to a3ce22d Compare May 15, 2023 06:22
"Tells if we should use compression for the state snapshot data or not");

public static final ConfigOption<Boolean> BUFFER_TIMEOUT_ENABLED =
ConfigOptions.key("execution.buffer-timeout.enabled")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FLINK-29372 limited that the option key cannot be a prefix of other options, however execution.buffer-timeout is the prefix of execution.buffer-timeout.enabled. So the CI fails.

Hi @zentol , could we update the option key for BUFFER_TIMEOUT and mark the "execution.buffer-timeout" as the DeprecatedKey? How about update it to execution.buffer-timeout.interval ? Or do you have any suggestions here? Looking forward to your opinion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about changing the config execution.buffer-timeout.enabled to execution.flush-on-buffer-full?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Myracle , thanks for your feedback.

I see too many related option names that all have the same prefix but different suffixes. From the user's point of view, the same prefix also clearly tells the user that these options are related. Therefore, when FLINK-29372 restricts the option prefix, it also adds suffixes to many option names that do not conform to the specification.

So I prefer keep the prefixes the same for these 2 options. In order to the reasonable of this fix, I look forward to more feedback from community.

Hi @wanglijie95 @reswqa , would you mind take a look this PR in your free time? thanks a lot.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename it to execution.buffer-timeout.interval and mark the old as deprecated key is ok from my side. But I want to hear @zentol's thoughts.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, I'm not sure do we need to start a discussion about this changes of configuration in the mailing list.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for name execution.buffer-timeout.interval

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename it to execution.buffer-timeout.interval. @zentol Would you like to give your thought? Thanks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

execution.buffer-timeout.interval and execution.buffer-timeout.enabled sound fine to me.

@Myracle Myracle force-pushed the FLINK-32023-support-negative-execution.buffer-timeout branch from 57d43fc to a1f6d45 Compare May 24, 2023 07:08
Copy link
Member

@1996fanrui 1996fanrui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Myracle 's update, LGTM.

@1996fanrui
Copy link
Member

I will merge this PR next Monday if no other comments.

Hi @Myracle , could you help squash all commits? thanks~

…nabled to flush only when the output buffer is full.
@Myracle Myracle force-pushed the FLINK-32023-support-negative-execution.buffer-timeout branch from a1f6d45 to 40636d9 Compare May 26, 2023 12:15
@1996fanrui
Copy link
Member

@flinkbot run azure

@1996fanrui
Copy link
Member

Thanks everyone who discussed here, and @Myracle 's contribution, merging.

@1996fanrui 1996fanrui merged commit 522ff83 into apache:master May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants