ceph osd pool set data hashpspool true
ceph osd pool set data hashpspool false
+ceph osd pool set data hashpspool 0
+ceph osd pool set data hashpspool 1
+expect_false ceph osd pool set data hashpspool asdf
+expect_false ceph osd pool set data hashpspool 2
+ ceph osd pool set rbd hit_set_type explicit_hash
+ ceph osd pool set rbd hit_set_type explicit_object
+ ceph osd pool set rbd hit_set_type bloom
+ expect_false ceph osd pool set rbd hit_set_type i_dont_exist
+ ceph osd pool set rbd hit_set_period 123
+ ceph osd pool set rbd hit_set_count 12
+ ceph osd pool set rbd hit_set_fpp .01
+
ceph osd pool get rbd crush_ruleset | grep 'crush_ruleset: 2'
ceph osd thrash 10
OPTION(osd_pool_default_pg_num, OPT_INT, 8) // number of PGs for new pools. Configure in global or mon section of ceph.conf
OPTION(osd_pool_default_pgp_num, OPT_INT, 8) // number of PGs for placement purposes. Should be equal to pg_num
OPTION(osd_pool_default_flags, OPT_INT, 0) // default flags for new pools
-OPTION(osd_pool_default_flag_hashpspool, OPT_BOOL, false) // use new pg hashing to prevent pool/pg overlap
+OPTION(osd_pool_default_flag_hashpspool, OPT_BOOL, true) // use new pg hashing to prevent pool/pg overlap
+ OPTION(osd_hit_set_min_size, OPT_INT, 1000) // min target size for a HitSet
+ OPTION(osd_hit_set_namespace, OPT_STR, ".ceph-internal") // rados namespace for hit_set tracking
OPTION(osd_map_dedup, OPT_BOOL, true)
OPTION(osd_map_cache_size, OPT_INT, 500)
OPTION(osd_map_message_max, OPT_INT, 100) // max maps per MOSDMap message
if (pending_inc.new_pools.count(pool))
p = pending_inc.new_pools[pool];
- // accept val as a json string or int, and parse out int or float
- // values from the string as needed
+ // accept val as a json string in the normal case (current
+ // generation monitor). parse out int or float values from the
+ // string as needed. however, if it is not a string, try to pull
+ // out an int, in case an older monitor with an older json schema is
+ // forwarding a request.
string val;
- cmd_getval(g_ceph_context, cmdmap, "val", val);
-- string interr;
++ string interr, floaterr;
int64_t n = 0;
- if (!cmd_getval(g_ceph_context, cmdmap, "val", n))
++ double f = 0;
+ if (!cmd_getval(g_ceph_context, cmdmap, "val", val)) {
+ // wasn't a string; maybe an older mon forwarded json with an int?
+ if (!cmd_getval(g_ceph_context, cmdmap, "val", n))
+ return -EINVAL; // no value!
+ } else {
+ // we got a string. see if it contains an int.
n = strict_strtoll(val.c_str(), 10, &interr);
- string floaterr;
- float f;
- if (!cmd_getval(g_ceph_context, cmdmap, "val", f))
++ // or a float
+ f = strict_strtod(val.c_str(), &floaterr);
+ }
if (var == "size") {
if (interr.length()) {
cancel_recovery();
}
+// For now only care about a single backfill at a time
void ReplicatedPG::on_activate()
{
- for (unsigned i = 1; i<acting.size(); i++) {
- if (peer_info[acting[i]].last_backfill != hobject_t::get_max()) {
- assert(backfill_target == -1);
- backfill_target = acting[i];
- last_backfill_started = peer_info[acting[i]].last_backfill;
- dout(10) << " chose backfill target osd." << backfill_target
- << " from " << last_backfill_started << dendl;
- }
- }
+ int backfill_target = get_backfill_target();
+ if (backfill_target == -1)
+ return;
+ last_backfill_started = peer_info[backfill_target].last_backfill;
+ assert(last_backfill_started != hobject_t::get_max());
+ dout(10) << " chose backfill target osd." << backfill_target
+ << " from " << last_backfill_started << dendl;
+
+ hit_set_setup();
}
void ReplicatedPG::on_change(ObjectStore::Transaction *t)
return false; // same primary (tho replicas may have changed)
}
- int Objecter::recalc_op_target(Op *op)
+bool Objecter::op_should_be_paused(Op *op)
+{
+ bool pauserd = osdmap->test_flag(CEPH_OSDMAP_PAUSERD);
+ bool pausewr = osdmap->test_flag(CEPH_OSDMAP_PAUSEWR) || osdmap->test_flag(CEPH_OSDMAP_FULL);
+
+ return (op->flags & CEPH_OSD_FLAG_READ && pauserd) ||
+ (op->flags & CEPH_OSD_FLAG_WRITE && pausewr);
+}
+
+ int64_t Objecter::get_object_hash_position(int64_t pool, const string& key,
+ const string& ns)
{
- vector<int> acting;
- pg_t pgid = op->pgid;
+ const pg_pool_t *p = osdmap->get_pg_pool(pool);
+ if (!p)
+ return -ENOENT;
+ return p->hash_key(key, ns);
+ }
+ int64_t Objecter::get_object_pg_hash_position(int64_t pool, const string& key,
+ const string& ns)
+ {
+ const pg_pool_t *p = osdmap->get_pg_pool(pool);
+ if (!p)
+ return -ENOENT;
+ return p->raw_hash_to_pg(p->hash_key(key, ns));
+ }
+
+ int Objecter::recalc_op_target(Op *op)
+ {
bool is_read = op->flags & CEPH_OSD_FLAG_READ;
bool is_write = op->flags & CEPH_OSD_FLAG_WRITE;
if (ret == -ENOENT)
return RECALC_OP_TARGET_POOL_DNE;
}
+ vector<int> acting;
osdmap->pg_to_acting_osds(pgid, acting);
+ bool need_resend = false;
+
+ bool paused = op_should_be_paused(op);
+ if (!paused && paused != op->paused) {
+ op->paused = false;
+ need_resend = true;
+ }
+
if (op->pgid != pgid || is_pg_changed(op->acting, acting, op->used_replica)) {
op->pgid = pgid;
op->acting = acting;
ip=""
nodaemon=0
smallmds=0
+ hitset=""
overwrite_conf=1
cephx=1 #turn cephx on by default
+memstore=0
MON_ADDR=""
-k )
overwrite_conf=0
;;
+ --memstore )
+ memstore=1
+ ;;
+ --hitset )
+ hitset="$hitset $2 $3"
+ shift
+ shift
+ ;;
-o )
extra_conf="$extra_conf $2
"