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

rocksdb_update_cf_option is useless/ignored when specified on command line or within my.cnf #889

Closed
georgelorchpercona opened this issue Oct 16, 2018 · 1 comment

Comments

@georgelorchpercona
Copy link
Contributor

@georgelorchpercona georgelorchpercona commented Oct 16, 2018

This seems to be due to the fact that SYSVAR 'validate' and 'update' callbacks are not called on startup when an option is specified either on the command line or in a .cnf file.  For MyRocks, we can either manually perform the validation and setting from the plugin init function, or, mark the option with PLUGIN_VAR_NOCMD_OPT.

Example:
Create a table with a custom column family:

mysql> create table t1(a int, primary key(a) comment 'cf1') engine=rocksdb;
Query OK, 0 rows affected (0.03 sec)

mysql> select cf_name, option_type, value from information_schema.rocksdb_cf_options where cf_name='cf1' and option_type like 'COMPRESSION%' order by option_type;
+---------+-----------------------+----------------+
| cf_name | option_type | value |
+---------+-----------------------+----------------+
| cf1 | COMPRESSION_OPTS | -14:32767:0 |
| cf1 | COMPRESSION_PER_LEVEL | NUL |
| cf1 | COMPRESSION_TYPE | kNoCompression |
+---------+-----------------------+----------------+
3 rows in set (0.00 sec)

Do a clean shutdown of musqld and restart with --rocksdb-update-cf-option='cf1={compression=kZLibCompression}'

mysql> select cf_name, option_type, value from information_schema.rocksdb_cf_options where cf_name='cf1' and option_type like 'COMPRESSION%' order by option_type;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 1
Current database: test

+---------+-----------------------+----------------+
| cf_name | option_type | value |
+---------+-----------------------+----------------+
| cf1 | COMPRESSION_OPTS | -14:32767:0 |
| cf1 | COMPRESSION_PER_LEVEL | NUL |
| cf1 | COMPRESSION_TYPE | kNoCompression |
+---------+-----------------------+----------------+
3 rows in set (0.01 sec)

@georgelorchpercona

This comment has been minimized.

Copy link
Contributor Author

@georgelorchpercona georgelorchpercona commented Oct 18, 2018

So yes, based on research and conversations I think the most proper thing to do is to simply add PLUGIN_VAR_NOCMD_OPT to the option definition. This probably doesn't have much value to fb-MyRocks but I think it does apply well to Percona Server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.