summaryrefslogtreecommitdiff
path: root/src/osd/ReplicatedPG.cc
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-10-01 13:43:02 -0700
committerSage Weil <sage@inktank.com>2013-10-01 13:43:02 -0700
commitf17432b90282cb971680af67ebeec108c42534f4 (patch)
tree47ecc63f661bc0d7b1f007358cded8cd37b1c8d0 /src/osd/ReplicatedPG.cc
parenta2fc66793f66d359bdb93549acd6aad0893ac5ce (diff)
downloadceph-wip-tmap.tar.gz
osd: remove magical tmap -> omap conversionwip-tmap
This is incomplete and unfortunately unusable in its current state: - it would only set USES_TMAP for old encoded object_info_t and tmapput, but would NOT set it for tmapup - a config option turned that off by default. That means that the mds conversion from tmap -> omap won't be able to use this because any existing cluster has tmap objects without the USES_TMAP flag set. And we don't want to unconditionally try a tmap->omap conversion on omap operations because there are lots of existing librados users out there that will be negatively impacted by this. Instead, the MDS will need to handle this conversion on the client side by reading either tmap or omap objects and explicitly rewriting the content with omap (while truncating the tmap data away). The auto-conversion function was added in v0.44. Signed-off-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'src/osd/ReplicatedPG.cc')
-rw-r--r--src/osd/ReplicatedPG.cc115
1 files changed, 0 insertions, 115 deletions
diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc
index aa20bbb57b8..4e7cbf1e22e 100644
--- a/src/osd/ReplicatedPG.cc
+++ b/src/osd/ReplicatedPG.cc
@@ -3290,11 +3290,6 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
}
}
- if (cct->_conf->osd_tmapput_sets_uses_tmap) {
- assert(cct->_conf->osd_auto_upgrade_tmap);
- oi.set_flag(object_info_t::FLAG_USES_TMAP);
- }
-
// write it
vector<OSDOp> nops(1);
OSDOp& newop = nops[0];
@@ -3340,29 +3335,6 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
}
set<string> out_set;
- if (oi.test_flag(object_info_t::FLAG_USES_TMAP) && cct->_conf->osd_auto_upgrade_tmap) {
- dout(20) << "CEPH_OSD_OP_OMAPGETKEYS: "
- << " Reading " << oi.soid << " omap from tmap" << dendl;
- map<string, bufferlist> vals;
- bufferlist header;
- int r = _get_tmap(ctx, &vals, &header);
- if (r == 0) {
- map<string, bufferlist>::iterator iter =
- vals.upper_bound(start_after);
- for (uint64_t i = 0;
- i < max_return && iter != vals.end();
- ++i, iter++) {
- out_set.insert(iter->first);
- }
- ::encode(out_set, osd_op.outdata);
- ctx->delta_stats.num_rd_kb += SHIFT_ROUND_UP(osd_op.outdata.length(), 10);
- ctx->delta_stats.num_rd++;
- break;
- }
- dout(10) << "failed, reading from omap" << dendl;
- // No valid tmap, use omap
- }
-
{
ObjectMap::ObjectMapIterator iter = osd->store->get_omap_iterator(
coll, soid
@@ -3398,30 +3370,6 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
}
map<string, bufferlist> out_set;
- if (oi.test_flag(object_info_t::FLAG_USES_TMAP) && cct->_conf->osd_auto_upgrade_tmap) {
- dout(20) << "CEPH_OSD_OP_OMAPGETVALS: "
- << " Reading " << oi.soid << " omap from tmap" << dendl;
- map<string, bufferlist> vals;
- bufferlist header;
- int r = _get_tmap(ctx, &vals, &header);
- if (r == 0) {
- map<string, bufferlist>::iterator iter = vals.upper_bound(start_after);
- if (filter_prefix > start_after) iter = vals.lower_bound(filter_prefix);
- for (uint64_t i = 0;
- i < max_return && iter != vals.end() &&
- iter->first.substr(0, filter_prefix.size()) == filter_prefix;
- ++i, iter++) {
- out_set.insert(*iter);
- }
- ::encode(out_set, osd_op.outdata);
- ctx->delta_stats.num_rd_kb += SHIFT_ROUND_UP(osd_op.outdata.length(), 10);
- ctx->delta_stats.num_rd++;
- break;
- }
- // No valid tmap, use omap
- dout(10) << "failed, reading from omap" << dendl;
- }
-
{
ObjectMap::ObjectMapIterator iter = osd->store->get_omap_iterator(
coll, soid
@@ -3449,19 +3397,6 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
case CEPH_OSD_OP_OMAPGETHEADER:
++ctx->num_read;
{
- if (oi.test_flag(object_info_t::FLAG_USES_TMAP) && cct->_conf->osd_auto_upgrade_tmap) {
- dout(20) << "CEPH_OSD_OP_OMAPGETHEADER: "
- << " Reading " << oi.soid << " omap from tmap" << dendl;
- map<string, bufferlist> vals;
- bufferlist header;
- int r = _get_tmap(ctx, &vals, &header);
- if (r == 0) {
- osd_op.outdata.claim(header);
- break;
- }
- // No valid tmap, fall through to omap
- dout(10) << "failed, reading from omap" << dendl;
- }
osd->store->omap_get_header(coll, soid, &osd_op.outdata);
ctx->delta_stats.num_rd_kb += SHIFT_ROUND_UP(osd_op.outdata.length(), 10);
ctx->delta_stats.num_rd++;
@@ -3480,28 +3415,6 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
goto fail;
}
map<string, bufferlist> out;
- if (oi.test_flag(object_info_t::FLAG_USES_TMAP) && cct->_conf->osd_auto_upgrade_tmap) {
- dout(20) << "CEPH_OSD_OP_OMAPGET: "
- << " Reading " << oi.soid << " omap from tmap" << dendl;
- map<string, bufferlist> vals;
- bufferlist header;
- int r = _get_tmap(ctx, &vals, &header);
- if (r == 0) {
- for (set<string>::iterator iter = keys_to_get.begin();
- iter != keys_to_get.end();
- ++iter) {
- if (vals.count(*iter)) {
- out.insert(*(vals.find(*iter)));
- }
- }
- ::encode(out, osd_op.outdata);
- ctx->delta_stats.num_rd_kb += SHIFT_ROUND_UP(osd_op.outdata.length(), 10);
- ctx->delta_stats.num_rd++;
- break;
- }
- // No valid tmap, use omap
- dout(10) << "failed, reading from omap" << dendl;
- }
osd->store->omap_get_values(coll, soid, keys_to_get, &out);
::encode(out, osd_op.outdata);
ctx->delta_stats.num_rd_kb += SHIFT_ROUND_UP(osd_op.outdata.length(), 10);
@@ -3579,9 +3492,6 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
case CEPH_OSD_OP_OMAPSETVALS:
++ctx->num_write;
{
- if (oi.test_flag(object_info_t::FLAG_USES_TMAP) && cct->_conf->osd_auto_upgrade_tmap) {
- _copy_up_tmap(ctx);
- }
if (!obs.exists) {
ctx->delta_stats.num_objects++;
obs.exists = true;
@@ -3609,9 +3519,6 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
case CEPH_OSD_OP_OMAPSETHEADER:
++ctx->num_write;
{
- if (oi.test_flag(object_info_t::FLAG_USES_TMAP) && cct->_conf->osd_auto_upgrade_tmap) {
- _copy_up_tmap(ctx);
- }
if (!obs.exists) {
ctx->delta_stats.num_objects++;
obs.exists = true;
@@ -3629,9 +3536,6 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
result = -ENOENT;
break;
}
- if (oi.test_flag(object_info_t::FLAG_USES_TMAP) && cct->_conf->osd_auto_upgrade_tmap) {
- _copy_up_tmap(ctx);
- }
t.touch(coll, soid);
t.omap_clear(coll, soid);
ctx->delta_stats.num_wr++;
@@ -3645,9 +3549,6 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
result = -ENOENT;
break;
}
- if (oi.test_flag(object_info_t::FLAG_USES_TMAP) && cct->_conf->osd_auto_upgrade_tmap) {
- _copy_up_tmap(ctx);
- }
t.touch(coll, soid);
set<string> to_rm;
try {
@@ -3821,22 +3722,6 @@ int ReplicatedPG::_get_tmap(OpContext *ctx,
return 0;
}
-int ReplicatedPG::_copy_up_tmap(OpContext *ctx)
-{
- dout(20) << "copying up tmap for " << ctx->new_obs.oi.soid << dendl;
- ctx->new_obs.oi.clear_flag(object_info_t::FLAG_USES_TMAP);
- map<string, bufferlist> vals;
- bufferlist header;
- int r = _get_tmap(ctx, &vals, &header);
- if (r < 0)
- return 0;
- ctx->op_t.omap_setkeys(coll, ctx->new_obs.oi.soid,
- vals);
- ctx->op_t.omap_setheader(coll, ctx->new_obs.oi.soid,
- header);
- return 0;
-}
-
inline int ReplicatedPG::_delete_head(OpContext *ctx)
{
SnapSet& snapset = ctx->new_snapset;