1. Send pool options to Bluestore which include compression options as well.
2. Add pool related stats to MPGStats so that they all compression details are available in 'ceph df detail' command.
Fixes: https://tracker.ceph.com/issues/59242
Signed-off-by: Aishwarya Mathuria <amathuri@redhat.com>
});
}
+seastar::future<> AlienStore::set_collection_opts(CollectionRef ch,
+ const pool_opts_t& opts)
+{
+ logger().debug("{}", __func__);
+ assert(tp);
+
+ return tp->submit(ch->get_cid().hash_to_shard(tp->size()), [=, this] {
+ auto c = static_cast<AlienCollection*>(ch.get());
+ return store->set_collection_opts(c->collection, opts);
+ }).then([] (int r) {
+ assert(r==0);
+ return seastar::now();
+ });
+}
+
AlienStore::read_errorator::future<ceph::bufferlist>
AlienStore::read(CollectionRef ch,
const ghobject_t& oid,
});
}
+seastar::future<store_statfs_t> AlienStore::pool_statfs(int64_t pool_id) const
+{
+ logger().info("{}", __func__);
+ assert(tp);
+ return do_with_op_gate(store_statfs_t{}, [this, pool_id] (store_statfs_t &st) {
+ return tp->submit([this, pool_id, &st]{
+ bool per_pool_omap_stats = false;
+ return store->pool_statfs(pool_id, &st, &per_pool_omap_stats);
+ }).then([&st] (int r) {
+ assert(r==0);
+ return seastar::make_ready_future<store_statfs_t>(std::move(st));
+ });
+ });
+}
+
unsigned AlienStore::get_max_attr_name_length() const
{
logger().info("{}", __func__);
seastar::future<CollectionRef> create_new_collection(const coll_t& cid) final;
seastar::future<CollectionRef> open_collection(const coll_t& cid) final;
seastar::future<std::vector<coll_core_t>> list_collections() final;
+ seastar::future<> set_collection_opts(CollectionRef c,
+ const pool_opts_t& opts) final;
seastar::future<> do_transaction_no_callbacks(
CollectionRef c,
const std::string& key) final;
uuid_d get_fsid() const final;
seastar::future<store_statfs_t> stat() const final;
+ seastar::future<store_statfs_t> pool_statfs(int64_t pool_id) const final;
unsigned get_max_attr_name_length() const final;
seastar::future<struct stat> stat(
CollectionRef,
std::map<std::string,bufferptr> xattr;
bool exists = true;
+ pool_opts_t pool_opts;
+
Collection(const coll_t& c);
~Collection() final;
});
}
+seastar::future<store_statfs_t> CyanStore::pool_statfs(int64_t pool_id) const
+{
+ return stat();
+}
+
CyanStore::mkfs_ertr::future<> CyanStore::mkfs(uuid_d new_osd_fsid)
{
return base_errorator::make_ready_future<bool>(true);
}
+seastar::future<>
+CyanStore::Shard::set_collection_opts(CollectionRef ch,
+ const pool_opts_t& opts)
+{
+ auto c = static_cast<Collection*>(ch.get());
+ logger().debug("{} {}", __func__, c->get_cid());
+ c->pool_opts = opts;
+ return seastar::now();
+}
+
CyanStore::Shard::read_errorator::future<ceph::bufferlist>
CyanStore::Shard::read(
CollectionRef ch,
seastar::future<CollectionRef> open_collection(const coll_t& cid) final;
+ seastar::future<> set_collection_opts(
+ CollectionRef c,
+ const pool_opts_t& opts) final;
+
seastar::future<> do_transaction_no_callbacks(
CollectionRef ch,
ceph::os::Transaction&& txn) final;
seastar::future<store_statfs_t> stat() const final;
+ seastar::future<store_statfs_t> pool_statfs(int64_t pool_id) const final;
+
uuid_d get_fsid() const final;
seastar::future<> write_meta(const std::string& key,
virtual seastar::future<CollectionRef> open_collection(const coll_t& cid) = 0;
+ virtual seastar::future<> set_collection_opts(CollectionRef c,
+ const pool_opts_t& opts) = 0;
+
protected:
virtual seastar::future<> do_transaction_no_callbacks(
CollectionRef ch,
virtual seastar::future<store_statfs_t> stat() const = 0;
+ virtual seastar::future<store_statfs_t> pool_statfs(int64_t pool_id) const = 0;
+
virtual uuid_d get_fsid() const = 0;
virtual seastar::future<> write_meta(const std::string& key,
});
}
+seastar::future<store_statfs_t> SeaStore::pool_statfs(int64_t pool_id) const
+{
+ //TODO
+ return SeaStore::stat();
+}
+
TransactionManager::read_extent_iertr::future<std::optional<unsigned>>
SeaStore::Shard::get_coll_bits(CollectionRef ch, Transaction &t) const
{
});
}
+seastar::future<>
+SeaStore::Shard::set_collection_opts(CollectionRef c,
+ const pool_opts_t& opts)
+{
+ //TODO
+ return seastar::now();
+}
+
seastar::future<std::vector<coll_core_t>>
SeaStore::Shard::list_collections()
{
seastar::future<CollectionRef> create_new_collection(const coll_t& cid) final;
seastar::future<CollectionRef> open_collection(const coll_t& cid) final;
+ seastar::future<> set_collection_opts(CollectionRef c,
+ const pool_opts_t& opts) final;
seastar::future<> do_transaction_no_callbacks(
CollectionRef ch,
mkfs_ertr::future<> mkfs(uuid_d new_osd_fsid) final;
seastar::future<store_statfs_t> stat() const final;
+ seastar::future<store_statfs_t> pool_statfs(int64_t pool_id) const final;
uuid_d get_fsid() const final {
ceph_assert(seastar::this_shard_id() == primary_core);
).then([this, m=std::move(m)](auto &&stats) mutable {
min_last_epoch_clean = osdmap->get_epoch();
min_last_epoch_clean_pgs.clear();
+ std::set<int64_t> pool_set;
for (auto [pgid, stat] : stats) {
min_last_epoch_clean = std::min(min_last_epoch_clean,
stat.get_effective_last_epoch_clean());
min_last_epoch_clean_pgs.push_back(pgid);
+ int64_t pool_id = pgid.pool();
+ pool_set.emplace(pool_id);
}
m->pg_stat = std::move(stats);
- return seastar::make_ready_future<MessageURef>(std::move(m));
+ return std::make_pair(pool_set, std::move(m));
+ }).then([this] (auto message) mutable {
+ std::map<int64_t, store_statfs_t> pool_stat;
+ auto pool_set = message.first;
+ auto m = std::move(message.second);
+ return seastar::do_with(std::move(m),
+ pool_stat,
+ pool_set, [this] (auto &&msg,
+ auto &pool_stat,
+ auto &pool_set) {
+ return seastar::do_for_each(pool_set, [this, &pool_stat]
+ (auto& pool_id) {
+ return store.pool_statfs(pool_id).then([pool_id, &pool_stat](
+ store_statfs_t st) mutable {
+ pool_stat[pool_id] = st;
+ });
+ }).then([&pool_stat, msg=std::move(msg)] () mutable {
+ msg->pool_stat = std::move(pool_stat);
+ return seastar::make_ready_future<MessageURef>(std::move(msg));
+ });
+ });
});
}
PeeringState::Initialize());
return seastar::now();
+ }).then([this, store]() {
+ logger().debug("{} setting collection options", __func__);
+ return store->set_collection_opts(
+ coll_ref,
+ get_pgpool().info.opts);
});
}
});
}
+void PG::init_collection_pool_opts()
+{
+ std::ignore = shard_services.get_store().set_collection_opts(coll_ref, get_pgpool().info.opts);
+}
+
+void PG::on_pool_change()
+{
+ init_collection_pool_opts();
+}
+
void PG::print(ostream& out) const
{
unsigned get_target_pg_log_entries() const final;
- void on_pool_change() final {
- // Not needed yet
- }
+ void init_collection_pool_opts();
+ void on_pool_change();
void on_role_change() final {
// Not needed yet
}