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

Set readTimeout to a value greater than switchOverTimeoutSeconds. #745

Closed
shunki-fujita opened this issue Oct 4, 2024 · 0 comments
Closed
Labels
bug Something isn't working

Comments

@shunki-fujita
Copy link
Contributor

shunki-fujita commented Oct 4, 2024

Describe the bug
Since readTimeout is short, it times out earlier than the switchOverTimeoutSeconds given to GetContext.

err = o.db.GetContext(ctx, &timeout, `SELECT WAIT_FOR_EXECUTED_GTID_SET(?, ?)`, gtid, timeoutSeconds)
if err != nil {
return fmt.Errorf("failed to wait GTID subset %s: %w", gtid, err)
}
if timeout {
return ErrTimeout
}

In this case, the error message is as follows, and it is hard to understand that it is a timeout:

  "error": "failed to failover: failed to wait GTID subset aaaa-bbbb-cccc-dddd-efgh:1-10: invalid connection",

The readTimeout setting is as follows:

readTimeout = 1 * time.Minute

For the same reason, failOverTimeoutSeconds is a meaningless value.

Expected behavior
Return ErrTimeout in case of timeout.
switchOverTimeoutSeconds should be shorter than readTimeout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant