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

[core] Introduce timeout for commit retry avoid long time loop #4668

Merged
merged 12 commits into from
Dec 10, 2024

Conversation

xuzifu666
Copy link
Member

@xuzifu666 xuzifu666 commented Dec 9, 2024

Purpose

  1. When execute drop partition or expire partition with large numbers partitions(eg: table with large number of files and stream job with 1 min ckp), would block batch job for overwrite in a long time loop, so add a timeout option for commit retry, user can quick get job result in a specific timeout to handle their batch job(which can adjust ckp time interval or stop stream job to finish their batch job).
  2. FileLength change to 4000 for CoreOption lines was near 3000 which would block code compile.

Linked issue: close #xxx

Tests

API and Format

Documentation

@@ -134,6 +135,7 @@ public class FileStoreCommitImpl implements FileStoreCommit {
private final List<CommitCallback> commitCallbacks;
private final StatsFileHandler statsFileHandler;
private final BucketMode bucketMode;
private final Optional<Duration> commitMaxTimeout;
Copy link
Contributor

@JingsongLi JingsongLi Dec 10, 2024

Choose a reason for hiding this comment

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

do not use optional for class member, you can use nullable field here.

@@ -1066,6 +1082,16 @@ public void compactManifest() {
commitMaxRetries));
}
retryCount++;

if (commitMaxTimeout.isPresent()
Copy link
Contributor

Choose a reason for hiding this comment

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

Please merge into if (retryCount >= commitMaxRetries).

@@ -754,6 +759,16 @@ private int tryCommit(
commitMaxRetries));
}
retryCount++;

if (commitMaxTimeout.isPresent()
Copy link
Contributor

Choose a reason for hiding this comment

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

Please merge into if (retryCount >= commitMaxRetries).

@@ -134,6 +134,12 @@
<td>Integer</td>
<td>Maximum number of retries when commit failed.</td>
</tr>
<tr>
<td><h5>commit.max-timeout</h5></td>
Copy link
Contributor

Choose a reason for hiding this comment

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

max timeout seems weird... it is just timeout?
commit.timeout

Copy link
Member Author

Choose a reason for hiding this comment

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

Make sense,changed to commit.timeout,Thanks~ @JingsongLi

@@ -166,7 +168,8 @@ public FileStoreCommitImpl(
BucketMode bucketMode,
@Nullable Integer manifestReadParallelism,
List<CommitCallback> commitCallbacks,
int commitMaxRetries) {
int commitMaxRetries,
@Nullable Duration commitMaxTimeout) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you modify all MaxTimeout to Timeout?

@@ -134,6 +135,7 @@ public class FileStoreCommitImpl implements FileStoreCommit {
private final List<CommitCallback> commitCallbacks;
private final StatsFileHandler statsFileHandler;
private final BucketMode bucketMode;
@Nullable private Duration commitMaxTimeout;
Copy link
Contributor

Choose a reason for hiding this comment

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

store millis here.

@xuzifu666 xuzifu666 changed the title [core] Introduce max-timeout for commit retry avoid long time loop [core] Introduce timeout for commit retry avoid long time loop Dec 10, 2024
@@ -134,6 +134,7 @@ public class FileStoreCommitImpl implements FileStoreCommit {
private final List<CommitCallback> commitCallbacks;
private final StatsFileHandler statsFileHandler;
private final BucketMode bucketMode;
@Nullable private long commitTimeout;
Copy link
Contributor

Choose a reason for hiding this comment

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

remove @nullable

@@ -166,7 +167,8 @@ public FileStoreCommitImpl(
BucketMode bucketMode,
@Nullable Integer manifestReadParallelism,
List<CommitCallback> commitCallbacks,
int commitMaxRetries) {
int commitMaxRetries,
@Nullable long commitTimeout) {
Copy link
Contributor

@JingsongLi JingsongLi Dec 10, 2024

Choose a reason for hiding this comment

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

remove @nullable

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. Thanks for reminder @JingsongLi

Copy link
Contributor

@JingsongLi JingsongLi left a comment

Choose a reason for hiding this comment

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

+1

@JingsongLi JingsongLi merged commit 8b4a77a into apache:master Dec 10, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants