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

[Enhancement] Exit getLabelState() if retry for more than a certain time #212

Merged
merged 2 commits into from
Apr 12, 2023

Conversation

banmoy
Copy link
Collaborator

@banmoy banmoy commented Apr 10, 2023

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Which issues of this PR fixes :

Fixes #

Problem Summary(Required) :

currently StarRocksStreamLoadVisitor#checkLabelState and DefaultStreamLoader#getLabelState will continue retrying if not get the expected label state. This may be caused by the bug of StarRocks, such as StarRocks/starrocks#21127. In this case, connector is better to throw some exception to tell the flink user what happens rather than stuck here, and then can investigate the problem.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr will affect users' behaviors
  • This pr needs user documentation (for new or modified features or behaviors)
  • I have added documentation for my new feature or new function

Signed-off-by: PengFei Li <lpengfei2016@gmail.com>
@@ -105,17 +105,29 @@ public Map<String, Object> doStreamLoad(StarRocksSinkBufferEntity bufferEntity)
} else if (RESULT_LABEL_EXISTED.equals(loadResult.get(keyStatus))) {
LOG.error(String.format("Stream Load response: \n%s\n", JSON.toJSONString(loadResult)));
// has to block-checking the state to get the final result
checkLabelState(host, bufferEntity.getLabel());
int timeoutSecond = 600;
String configuredTimeout = sinkOptions.getSinkStreamLoadProperties().get("timeout");
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be better to get it early, and Isn't it ten minutes by default if you don't set it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What do you mean by "get it early"? 600s is just ten minutes

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

Signed-off-by: PengFei Li <lpengfei2016@gmail.com>
@banmoy banmoy merged commit e0a102e into StarRocks:main Apr 12, 2023
banmoy added a commit to banmoy/starrocks-connector-for-apache-flink that referenced this pull request Apr 23, 2023
…ime (StarRocks#212)

Signed-off-by: PengFei Li <lpengfei2016@gmail.com>
banmoy added a commit to banmoy/starrocks-connector-for-apache-flink that referenced this pull request Apr 23, 2023
…ime (StarRocks#212)

Signed-off-by: PengFei Li <lpengfei2016@gmail.com>
banmoy added a commit to banmoy/starrocks-connector-for-apache-flink that referenced this pull request Apr 23, 2023
…ime (StarRocks#212)

Signed-off-by: PengFei Li <lpengfei2016@gmail.com>
banmoy added a commit to banmoy/starrocks-connector-for-apache-flink that referenced this pull request May 5, 2023
…ime (StarRocks#212)

Signed-off-by: PengFei Li <lpengfei2016@gmail.com>
banmoy added a commit to banmoy/starrocks-connector-for-apache-flink that referenced this pull request May 5, 2023
…ime (StarRocks#212)

Signed-off-by: PengFei Li <lpengfei2016@gmail.com>
banmoy added a commit that referenced this pull request May 5, 2023
…ime (#212)

Signed-off-by: PengFei Li <lpengfei2016@gmail.com>
banmoy added a commit that referenced this pull request May 5, 2023
…ime (#212)

Signed-off-by: PengFei Li <lpengfei2016@gmail.com>
banmoy added a commit that referenced this pull request May 5, 2023
…ime (#212)

Signed-off-by: PengFei Li <lpengfei2016@gmail.com>
banmoy added a commit that referenced this pull request May 5, 2023
…ime (#212)

Signed-off-by: PengFei Li <lpengfei2016@gmail.com>
banmoy added a commit that referenced this pull request May 5, 2023
…ime (#212)

Signed-off-by: PengFei Li <lpengfei2016@gmail.com>
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