From 98caba1d0b4dd334748e3bcaf1bfb3f79f75eb65 Mon Sep 17 00:00:00 2001 From: Jianpeng Ma Date: Thu, 24 Mar 2016 17:49:39 +0800 Subject: [PATCH] osd/ReplicatedPG: For omap read ops, it should check object wether has omap For set omap heaader or k/v, it set FLAG_OMAP. When remove header or k/v, it don't remove FLAG_OMAP because it don't know object whether have omap header or other k/vs. Though object has FLAG_OMAP dont mean now it has omap header or k/v, it better check FLAG_OMAP than pool whether support omap operations for omap reads. Signed-off-by: Jianpeng Ma --- src/osd/ReplicatedPG.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index a50dc5136a12b..8350aeaadcf8e 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -5516,7 +5516,7 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector& ops) tracepoint(osd, do_osd_op_pre_omapgetkeys, soid.oid.name.c_str(), soid.snap.val, start_after.c_str(), max_return); set out_set; - if (pool.info.supports_omap()) { + if (oi.is_omap()) { ObjectMap::ObjectMapIterator iter = osd->store->get_omap_iterator( coll, ghobject_t(soid) ); @@ -5553,7 +5553,7 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector& ops) tracepoint(osd, do_osd_op_pre_omapgetvals, soid.oid.name.c_str(), soid.snap.val, start_after.c_str(), max_return, filter_prefix.c_str()); map out_set; - if (pool.info.supports_omap()) { + if (oi.is_omap()) { ObjectMap::ObjectMapIterator iter = osd->store->get_omap_iterator( coll, ghobject_t(soid) ); @@ -5579,7 +5579,7 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector& ops) case CEPH_OSD_OP_OMAPGETHEADER: tracepoint(osd, do_osd_op_pre_omapgetheader, soid.oid.name.c_str(), soid.snap.val); - if (!pool.info.supports_omap()) { + if (!oi.is_omap()) { // return empty header break; } @@ -5605,7 +5605,7 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector& ops) } tracepoint(osd, do_osd_op_pre_omapgetvalsbykeys, soid.oid.name.c_str(), soid.snap.val, list_entries(keys_to_get).c_str()); map out; - if (pool.info.supports_omap()) { + if (oi.is_omap()) { osd->store->omap_get_values(ch, ghobject_t(soid), keys_to_get, &out); } // else return empty omap entries ::encode(out, osd_op.outdata); @@ -5635,7 +5635,7 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector& ops) map out; - if (pool.info.supports_omap()) { + if (oi.is_omap()) { set to_get; for (map >::iterator i = assertions.begin(); i != assertions.end(); -- 2.39.5