On Wed, Jul 29, 2020 at 9:07 AM Jason Dillaman
<jdillama(a)redhat.com>
wrote:
On Wed, Jul 29, 2020 at 9:03 AM Wido den Hollander <wido(a)42on.com>
wrote:
On 29/07/2020 14:54, Jason Dillaman wrote:
> On Wed, Jul 29, 2020 at 6:23 AM Wido den Hollander <wido(a)42on.com>
> wrote:
>>
>> Hi,
>>
>> I'm trying to have clients read the 'rbd_default_data_pool' config
>> option from the config store when creating a RBD image.
>>
>> This doesn't seem to work and I'm wondering if somebody knows why.
>
> It looks like all string-based config overrides for RBD are ignored:
>
> 2020-07-29T08:52:44.393-0400 7f2a97fff700 4 set_mon_vals failed to
> set rbd_default_data_pool = rbd-data: Configuration option
> 'rbd_default_data_pool' may not be modified at runtime
>
> librbd always accesses the config options in a thread-safe manner, so
> I'll open a tracker ticket to flag all the RBD string config options
> are runtime updatable (primitive data type options are implicitly
> runtime updatable).
I wasn't updating it at runtime, I just wanted to make sure that I
don't
have to set this in ceph.conf everywhere (and libvirt doesn't read
ceph.conf)
You weren't updating it at runtime -- the MON's "MConfig" message back
to the client was attempting to set the config option after "rbd" had
already started. However, if it's working under python, perhaps there
is an easy tweak for "rbd" to have it delay flagging the application
as having started until after it has connected to the cluster. Right
now it manages its own CephContext lifetime which it re-uses when
creating a librados connection. It's that CephContext that is flagged
as "running" prior to librados actually connecting to the cluster.
It looks like this is caused by two issues:
-- In [1], this will prevent librados from applying any MON config
overrides (for strings). This line can just be trivially removed.
-- Fixing that, there is a race in librados / MonClient [2] where it
attempts to first pull the config from the MONs, but it uses a
separate thread to actually apply the received config values, which
can race w/ the completion of the bootstrap occurring in the main
thread. This means that the example below may work sometimes -- and
may fail other times.
Interesting! In this case it will be libvirt which runs for ever and
talks to librbd/librados.
I'll need to see how that works out. I'll test and report back.