We need to tell the ObjectStore's Collections what the pool options are
for things like the bluestore compression mode and so on to take effect.
Apply these
- when we create new collections, due to a new pg or a split
- when we start up and open an existing collection
We already apply these changes when there is a pool change.
Fixes: https://tracker.ceph.com/issues/40483
Signed-off-by: Sage Weil <sage@redhat.com>
false,
rctx.transaction);
+ pg->init_collection_pool_opts();
+
if (pg->is_primary()) {
Mutex::Locker locker(m_perf_queries_lock);
pg->set_dynamic_perf_stats_queries(m_perf_queries);
child,
split_bits);
+ child->init_collection_pool_opts();
+
child->finish_split_stats(*stat_iter, rctx.transaction);
child->unlock();
}
recovery_state.set_role(-1);
}
+ // init pool options
+ store->set_collection_opts(ch, pool.info.opts);
+
PeeringCtx rctx;
handle_initialize(rctx);
// note: we don't activate here because we know the OSD will advance maps
}
}
-void PG::on_pool_change()
+void PG::init_collection_pool_opts()
{
auto r = osd->store->set_collection_opts(ch, pool.info.opts);
- if(r < 0 && r != -EOPNOTSUPP) {
+ if (r < 0 && r != -EOPNOTSUPP) {
derr << __func__ << " set_collection_opts returns error:" << r << dendl;
}
+}
+
+void PG::on_pool_change()
+{
+ init_collection_pool_opts();
plpg_on_pool_change();
}
void on_role_change() override;
virtual void plpg_on_role_change() = 0;
+ void init_collection_pool_opts();
void on_pool_change() override;
virtual void plpg_on_pool_change() = 0;