Page MenuHomePhabricator

[nix] Enable `performance_schema` by default on Nix
ClosedPublic

Authored by atul on Sep 27 2023, 11:01 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 29, 4:55 PM
Unknown Object (File)
Fri, Nov 29, 4:32 PM
Unknown Object (File)
Fri, Nov 29, 1:12 PM
Unknown Object (File)
Wed, Nov 20, 5:39 AM
Unknown Object (File)
Fri, Nov 15, 8:05 AM
Unknown Object (File)
Fri, Nov 15, 8:05 AM
Unknown Object (File)
Fri, Nov 15, 8:05 AM
Unknown Object (File)
Fri, Nov 15, 8:05 AM
Subscribers
None

Details

Reviewers
ashoat
ginsu
tomek
rohan
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rCOMMad467672c5c6: [nix] Enable `performance_schema` by default on Nix
Summary
Test Plan

performance_schema is set as expected when using (newly-created) Nix-backed MariaDB database:

7d57d5.png (534×1 px, 55 KB)

Diff Detail

Repository
rCOMM Comm
Branch
master
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Owners added a reviewer: Restricted Owners Package.Sep 27 2023, 11:01 AM
atul published this revision for review.Sep 27 2023, 11:01 AM
atul edited the test plan for this revision. (Show Details)
ashoat requested changes to this revision.Sep 27 2023, 11:18 AM
ashoat added inline comments.
nix/mariadb-up-mac.nix
17

Hmm, this doesn't feel great to me... you're overwriting the contents of the user's ~/.my.cnf file. This feels intense... in general applications shouldn't touch user-defined configuration. What if the user wants to customize this? What if the user already had a file like this for eg. a local MySQL instance, and we completely clear it?

Is it possible to instead pass this as a param when we run MariaDB on line 27? If not, is appending an option or will that lead to an infinitely-growing file? If not, is there another file we can edit that isn't in the userdir? (Ideally it's specific to our Nix-sourced MariaDB, and doesn't affect any other installs.)

This revision now requires changes to proceed.Sep 27 2023, 11:18 AM

different approach that doesn't override $HOME/.my.cnf, continues to work:

7d57d5.png (534×1 px, 55 KB)

Way better, thanks. Can we rename the file to make it clear it's MariaDB config? How about .localmariadb.cnf?

This revision is now accepted and ready to land.Sep 27 2023, 11:38 AM

looks like it can be even simpler...

got thrown off by some old MySQL docs and an incorrect comment someone left saying that performance-schema needed to included in config file and couldn't be passed to command line

but found the following on GitHub: https://github.com/Percona-Lab/mysql_random_data_load/blob/master/docker-compose.yml

and then also verified that it worked for us