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

database/sql: retry + exponential backoff for SQL queries #34770

Closed
mcandre opened this issue Oct 8, 2019 · 2 comments
Closed

database/sql: retry + exponential backoff for SQL queries #34770

mcandre opened this issue Oct 8, 2019 · 2 comments
Labels
FeatureRequest FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@mcandre
Copy link

mcandre commented Oct 8, 2019

When a SQL query experiences a retriable failure, could we introduce a growing delay between retries?

That way, failures due to shifting Active SQL instances in a distributed formation, give the client enough time to wait for the cluster to become available again.

Same story for loadbalancing across ProxySQL instances: When one goes down, it takes a bit for the other ProxySQL to become available for servicing queries.

@smasher164
Copy link
Member

smasher164 commented Oct 8, 2019

I'm not sure if I understand the suggestion here. Is this meant as an enhancement to database/sql, where queries are retried automatically?

AFAIK connections are already pooled and reopened up to a limit, so I suppose queries could similarly be retried. Regarding the backoff, adding jitter would likely be important if this is done, as to avoid collisions.

I'm also not sure if retryable errors are something exposed by every database driver, and what constitutes as one.

@kardianos

@smasher164 smasher164 added FeatureRequest WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Oct 8, 2019
@smasher164 smasher164 changed the title Exponential backoff for SQL retries database/sql: retry + exponential backoff for SQL queries Oct 8, 2019
@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@golang golang locked and limited conversation to collaborators Nov 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FeatureRequest FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants