Skip to content

Commit

Permalink
pg_pool_t: enable FLAG_HASHPSPOOL by default
Browse files Browse the repository at this point in the history
Fixes: ceph#5160
Signed-off-by: Samuel Just <[email protected]>
Reviewed-by: Greg Farnum <[email protected]>
Reviewed-by: Sage Weil <[email protected]>
  • Loading branch information
Samuel Just committed May 24, 2013
1 parent bb407bf commit 6d1e14e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/common/config_opts.h
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ OPTION(osd_pool_default_min_size, OPT_INT, 0) // 0 means no specific default; c
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
// default flags for new pools
OPTION(osd_pool_default_flag_hashpspool, OPT_BOOL, true)
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
Expand Down
2 changes: 2 additions & 0 deletions src/mon/OSDMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2431,6 +2431,8 @@ int OSDMonitor::prepare_new_pool(string& name, uint64_t auid, int crush_rule,
int64_t pool = ++pending_inc.new_pool_max;
pending_inc.new_pools[pool].type = pg_pool_t::TYPE_REP;
pending_inc.new_pools[pool].flags = g_conf->osd_pool_default_flags;
if (g_conf->osd_pool_default_flag_hashpspool)
pending_inc.new_pools[pool].flags |= pg_pool_t::FLAG_HASHPSPOOL;

pending_inc.new_pools[pool].size = g_conf->osd_pool_default_size;
pending_inc.new_pools[pool].min_size = g_conf->get_osd_pool_default_min_size();
Expand Down
4 changes: 4 additions & 0 deletions src/osd/OSDMap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1737,6 +1737,8 @@ void OSDMap::build_simple(CephContext *cct, epoch_t e, uuid_d &fsid,
int64_t pool = ++pool_max;
pools[pool].type = pg_pool_t::TYPE_REP;
pools[pool].flags = cct->_conf->osd_pool_default_flags;
if (cct->_conf->osd_pool_default_flag_hashpspool)
pools[pool].flags |= pg_pool_t::FLAG_HASHPSPOOL;
pools[pool].size = cct->_conf->osd_pool_default_size;
pools[pool].min_size = cct->_conf->get_osd_pool_default_min_size();
pools[pool].crush_ruleset = p->first;
Expand Down Expand Up @@ -1862,6 +1864,8 @@ int OSDMap::build_simple_from_conf(CephContext *cct, epoch_t e, uuid_d &fsid,
int64_t pool = ++pool_max;
pools[pool].type = pg_pool_t::TYPE_REP;
pools[pool].flags = cct->_conf->osd_pool_default_flags;
if (cct->_conf->osd_pool_default_flag_hashpspool)
pools[pool].flags |= pg_pool_t::FLAG_HASHPSPOOL;
pools[pool].size = cct->_conf->osd_pool_default_size;
pools[pool].min_size = cct->_conf->get_osd_pool_default_min_size();
pools[pool].crush_ruleset = p->first;
Expand Down

0 comments on commit 6d1e14e

Please sign in to comment.