]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
common: do not dup the options when reexpanding 38340/head
authorXiubo Li <xiubli@redhat.com>
Mon, 23 Nov 2020 12:55:01 +0000 (20:55 +0800)
committerNathan Cutler <ncutler@suse.com>
Fri, 4 Dec 2020 11:22:06 +0000 (12:22 +0100)
commit4b4aa87d6a7be6312a34064dea627d082dc4832f
tree063ce48992d39f2b49170d280752baa3881cf19d
parent26369c39dff5a04d5918eec6586db68e828623dd
common: do not dup the options when reexpanding

The old code will store all the options, which has `$pid` in them,
in may_reexpand_meta map. And when reexpanding later, the reexpand
code will dup them with a higher priority(CONF_OVERRIDE).

This will be a problem, if the default value has `$pid` and be
stored in the may_reexpand_meta map, and then the code set a new
different value, which may have no `$pid`, from CLI or config file.
The reexpand will override it with the default value always.

This will do not duplicate the options with CONF_OVERRIDE priority
when reexpanding, just refresh them and call the observers. And the
finalize_reexpand_meta() will always be called after the fork() is
done in child processes.

Fixes: https://tracker.ceph.com/issues/48240
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit 56ca87ae3b3c341a78a8df8f95d3bf31828c9108)
src/common/config.cc
src/common/config.h