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

[feature] add write blocking properties to control write blocking. #117

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

CodeCooker17
Copy link
Contributor

Proposed changes

Issue Number: close #xxx

Problem Summary:

Describe the overview of changes.
add three config to control write blocking. Prevent write failure due to cpmpaction not being timely to improve write success rate.
--- max blocking times
"doris.sink.max.blocking.times" = "8",
--- max blocking interval times per blocking
"doris.sink.max.blocking.interval.ms" = "300000",
--- need to blocking write keys
"doris.sink.block.trigger.keys" = "-235,-238,-233"

Checklist(Required)

  1. Does it affect the original behavior: (Yes/No/I Don't know)
  2. Has unit tests been added: (Yes/No/No Need)
  3. Has document been added or modified: (Yes/No/No Need)
  4. Does it need to update dependencies: (Yes/No)
  5. Are there any changes that cannot be rolled back: (Yes/No)

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

}

def shouldBlock(exception: String): Boolean = {
blockTriggerKeysArray.exists(exception.contains)
Copy link
Member

Choose a reason for hiding this comment

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

Will there be any problems with this judgment, for example, it is not -235, but -235 appears?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In order to prevent misjudgment, you can set a more identifiable key, such as 'err=-235,error-238'

@@ -90,6 +90,16 @@ public interface ConfigurationOptions {

int DORIS_SINK_BATCH_INTERVAL_MS_DEFAULT = 50;

String DORIS_SINK_MAX_BLOCKING_TIMES = "doris.sink.max.blocking.times";
Copy link
Member

Choose a reason for hiding this comment

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

Is this parameter similar to sink.max-retries?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

'sink.max-retries' is to specify the maximum number of retries for other exceptions, and 'doris.sink.max.blocking.times' is to specify the maximum number of retries when 'doris.sink.block.trigger.keys' appears, Often in order to ensure the success of data import, 'doris.sink.max.blocking.times' is usually set larger

@gnehil
Copy link
Contributor

gnehil commented Sep 14, 2023

After the optimization PR of #140, doris will stream the data when writing in http chuck mode, which to a certain extent avoids the compaction problems caused by large batch data load.
And these exception codes are abnormal phenomena caused by doris failures, so they should be exposed and repaired on the doris side, and should not be blocked during writing.

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.

3 participants