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

Ability to configure features that are not CLI flags #23

Open
acroos opened this issue Feb 17, 2021 · 0 comments
Open

Ability to configure features that are not CLI flags #23

acroos opened this issue Feb 17, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@acroos
Copy link
Contributor

acroos commented Feb 17, 2021

As this project matures, we will likely want to offer features on top of what the gh-ost CLI offers. To do this, we need to enable configuration options that are not CLI arguments. An example would be to generate a dynamic postpone cutover flag file path based on the table (/tmp/gh-ost/postpone-cut-over<table>.flag)

Describe the solution you'd like
There are two solutions I'm currently split on:

  • namespace some sort of "enhanced" features, so the config would be like config.ghost_adapter.enhanced.feature = 100 (of course the naming needs some work). This means that any config options with under enhanced would be automatically skipped when converting to CLI args (avoiding potential bugs and future work)
  • add a sort of string interpolation option where a user could do something like: config.ghost_adapter.panic_flag_file = "/tmp/gh-ost/panic-%table%.flag" (and we replace %table% with the table name). of course, the actual syntax here is very much TBD (maybe just use ERB?)

Describe alternatives you've considered

  • A naïve solution would be to just add accepted options to the config class and then ignore specific keys when converting the config to CLI args.
  • We could offer separate setup methods for setting up the CLI args and setting up ghost_adapter specific features

Additional context
It would be nice to offer users the ability to say that they want a flag like --postpone-cut-over-flag-file to have a value based on the table that is being migrated. This is safer than using a static value and nicer than requiring users to implement some sort of custom logic to generate unique values. We could easily offer a config option like config.ghost_adapter.enhanced.table_specific_postpone_cut_over_flag_file = true where we would generate a path (or maybe something where they pass a directory and we would just generate the filename)

@acroos acroos added the enhancement New feature or request label Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant