tarantool/tarantool-operator

Cartridge config step is not working properly

d-enk opened this issue · 1 comments

d-enk commented

cartridge.config_get_readonly()
returns 2 config content types - lua table by key & its plaintext by key.yml

This results in the inability to correctly compare the actual and the desired configs.

Anyway why is NextStep not used here?

The main problem occurs here, when setting box.NULL to an existing key from the actual config into the desired when it is missing.

Let's say the current config contains key & key.yml
Even if the new config contains the field key it will be removed because will be called
cartridge.config_patch_clusterwide({'key' = {...}, 'key.yml' = box.NULL})

Example to reproduce

Apply this config

config:
  key: { val: 1 }

Upgrade it

config:
  key: { val: 2 }

Expected config with key.val == 2 but key was removed

Moreover, you can`t delete part of the current config just because it is not in new.
This part could be set by internal or any other logic.

To remove, you can explicitly set null in the yaml, as required by cartridge.config_patch_clusterwide.

Fixed in master branch, implemented behavior as described in this PR