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

[client-v2] Retries #1692

Closed
chernser opened this issue Jun 17, 2024 · 1 comment · Fixed by #1768
Closed

[client-v2] Retries #1692

chernser opened this issue Jun 17, 2024 · 1 comment · Fixed by #1768

Comments

@chernser
Copy link
Contributor

chernser commented Jun 17, 2024

Retries

Request to a server may fail and then retried depending on a reason. For example, when connection timeouted it may be retried with same target or next another one.
Policy for retries is application configuration and Java Client should be very flexible in way automatic retries can be configured.

Each retry attempt consumes some time and it may be a problem. For example, application sets maximum execution time and retry attempt take 90% of this limit. In such
case there is no benefit doing a retry attempt. Therefore retry logic should respect any configured time limitations.

This is client feature and feature should be guaranteed by client. If underlying transport has retries mechanism it make sense to limit its use.

Settings

  • com.clickhouse.client.config.ClickHouseClientOption#RETRY "Maximum number of times retry can happen for a request, zero or negative value means no retry."
    This setting should be deprecated because it is has too broad meaning. Instead new should be created:

    • client.max_connection_retries - Maximum number of times a request can be retried if connection initiation error happens.
  • com.clickhouse.client.config.ClickHouseClientOption#MAX_EXECUTION_TIME "Maximum query execution time in seconds, 0 means no limit."
    This configuration setting should be respected when checking if retry is needed.

  • com.clickhouse.client.config.ClickHouseClientOption#REPEAT_ON_SESSION_LOCK "Whether to repeat execution when session is locked, until timed out(according to 'session_timeout' or 'connect_timeout')."
    This options should be kept.

Metrics

  • number_of_retries - counter of number of retries per operation type.
@mzitnik
Copy link
Contributor

mzitnik commented Jun 18, 2024

@chernser i would like also impact the old client api

@chernser chernser changed the title [client-v2] Implement retry strategy interface [client-v2] Retries Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants