]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
common: do not dup the options when reexpanding 38830/head
authorXiubo Li <xiubli@redhat.com>
Mon, 23 Nov 2020 12:55:01 +0000 (20:55 +0800)
committerNathan Cutler <ncutler@suse.com>
Wed, 27 Jan 2021 20:45:20 +0000 (21:45 +0100)
commit7b5401662198ac7aa1df71377c1fc37604072936
tree37cd8f670693b3a07f0fd7ab63880e4616764c5c
parent9fb9187e0b8123213fcea3d2727f315fd85ebfa0
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