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

Improve Default BaseDSN field in MySQBackendConfig #15

Open
shawnHartsell opened this issue May 21, 2020 · 1 comment
Open

Improve Default BaseDSN field in MySQBackendConfig #15

shawnHartsell opened this issue May 21, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@shawnHartsell
Copy link
Contributor

When setting up the setting up the defaults for the MySQLBackendConfig. If a BaseDSN is not supplied by a called then it will default to this structure:

fmt.Sprintf("%s:%s@tcp(%s:%d)/?parseTime=true", m.User, m.Password, m.Host, m.Port)

This DSN is missing a few critical items:

  • database name: if this field is missing then a lock can't be required if the database server becomes unavailable
  • timeouts: not having a timeout defined means that calls can wait forever. This is exacerbated if the issue occurs during the master heartbeat
@shawnHartsell shawnHartsell added the bug Something isn't working label May 21, 2020
@changsongl
Copy link

I have same issue with database name bug.
“failed to acquire lock while becoming master: failed to fetch current master state: Error 1046: No database selected”

Right now, I just use my own DSN instead of giving all mysql connection parameters. And I also fix the timeout problems by passing BaseDSN.

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

2 participants