-
Notifications
You must be signed in to change notification settings - Fork 246
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
mysql: wire up the mysql datastore engine to the CLI #532
Conversation
mysql.MaxOpenConns(opts.MaxOpenConns), | ||
mysql.RevisionFuzzingTimedelta(opts.RevisionQuantization), | ||
mysql.TablePrefix(opts.TablePrefix), | ||
mysql.EnablePrometheusStats(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sbryant I ended up enabling by default the prometheus stats, I couldn't figure out how to wire it up with EnableDatastoreMetrics
, just like the PSQL driver recently did.
@ecordell since you introduced that internal flag, is that something that can be passed as an ENV variable via CLI? I couldn't figure out why it wasn't being parsed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way I read the cobrautil setup is that a flag still needs to be defined for the env var approach to work? https://github.com/jzelinskie/cobrautil/blob/main/cobrautil.go#L38
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct - right now that option is not bound to a cli flag. If you bind EnableDatastoreMetrics
to a flag in RegisterDatastoreFlags
then you'll be able to set it via CLI or env vars
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ecordell how does that flag even work then? How are metrics ever turned on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@authzed test ping
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sbryant It wasn't being used anywhere, it was a flag we could turn on during tests if we wanted to (via code)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sbryant It wasn't being used anywhere, it was a flag we could turn on during tests if we wanted to (via code)
Ahh okay! Thanks for the explanation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ecordell as it stands, it means that postgresql prometheus metrics are off by default, and there is no way to turn them on via the CLI? Is that intentional? They used to be on by default so that would be a regression for any customers running PSQL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like this may need to be addressed, but a followup should do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vroldanbet You're right, they were on by default before. I've filed #549 to follow up and change the default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, we can follow up on the prometheus flag. Deferring to @authzed/spicedb-maintainers
10172f4
to
d0d1a4d
Compare
74e9e3f
to
2ada77a
Compare
7ee66cf
to
85eb5f4
Compare
@josephschorr i believe this is ready to go, is there anything else missing? |
Co-authored-by: Alex Slepak <ams11@github.com> Co-authored-by: Christopher Kirkland <chriskirkland@github.com> Co-authored-by: Hannah Gould <hagould@github.com> Co-authored-by: John Reed <johnpreed@github.com> Co-authored-by: Víctor Roldán Betancort <vroldanbet@github.com>
mysql docs recommend using utf8mb3 since ut8 will eventually become an alias for utf8mb4 https://dev.mysql.com/doc/refman/8.0/en/charset-unicode-utf8.html
85eb5f4
to
26f7e29
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The failures appear to be unrelated to this PR. I can't seem to force an retry workflow either :( |
I've rerun them |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
found a bug, let's fix on a follow up!
migrationDriver, err = mysqlmigrations.NewMySQLDriverFromDSN(dbURL, tablePrefix) | ||
if err != nil { | ||
log.Fatal().Err(err).Msg("unable to create migration driver") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sbryant I believe there is a bug here: manager
is not being set to the MySQL migration manager.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
follow up in #550
This PR adds the mysql datastore options to the CLI.
datastore-mysql-table-prefix
supportspicedb migrate
support