cmu-db / ottertune

The automatic DBMS configuration tool
Other
1.22k stars 311 forks source link

fix bugs when number of tunable knobs changes or are inconsistent #368

Closed yangdsh closed 4 years ago

yangdsh commented 4 years ago

Issue:

In the knob_data, there was a text field that has all global tunable knobs (not session tunable knobs). However, the number of global tunable knobs can increase over time, leading to inconsistent knob_data between previous results and current results, and between previous sessions and current sessions. Therefore, we get an error when we aggregate data when running lasso and other tasks.

By the way, I think the global tunable knobs are no longer useful and should be deprecated.

Possible Solutions:

There are three ways:

  1. When detecting a change in the number of global tunable knobs, modify all previous data. This is not a good solution because such a change can happen everywhere and there is not a single place we can handle this.
  2. When we need to aggregate knob_data, we amend the previous knob files which lack new knob values. This is not a good solution, because it has to be done every time we aggregate data, and it is complex to retrieve the lacking knob value from previous results.
  3. From the beginning, we parse and save all the knobs, not only the tunable knobs. Therefore, the set of the knobs is static and will not be affected by future changes.

Implementation

  1. Add a parameter knob_catalog to convert_dbms_knobs, in order to control which set of the knobs we want to convert. Previously, we can only convert global tunable knobs.
  2. When calling convert_dbms_knobs, use all non-string type knobs as knob_catalog.
  3. Non-tunable knobs are not given enough information, eg. they have no varType and no min/max value. I modified the code to accommodate that.
  4. Notice: tests are changed. When converting an empty string to an integer, the expected behavior now is returning 0 instead of throwing an exception.

I did some tests, and both the two types of bugs you showed me are solved. Lasso can run with multiple sessions now. But you will need to re-update those socgen results after this PR is merged.

dvanaken commented 4 years ago

@yangdsh Thanks!