]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: create max hitset size 2437/head
authorSamuel Just <sam.just@inktank.com>
Wed, 3 Sep 2014 22:49:47 +0000 (15:49 -0700)
committerSamuel Just <sam.just@inktank.com>
Tue, 9 Sep 2014 19:26:49 +0000 (12:26 -0700)
Otherwise, hit_set_create could create an unbounded size hitset
object.

Fixes: #9339
Backport: firefly
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/common/config_opts.h
src/osd/ReplicatedPG.cc

index a065a772f9b13021ca87ba64fa99e95ac940ca82..e65ecf8db27241e931d36d22b0e7a30cd2c5b3d7 100644 (file)
@@ -441,6 +441,7 @@ OPTION(osd_pool_default_cache_target_full_ratio, OPT_FLOAT, .8)
 OPTION(osd_pool_default_cache_min_flush_age, OPT_INT, 0)  // seconds
 OPTION(osd_pool_default_cache_min_evict_age, OPT_INT, 0)  // seconds
 OPTION(osd_hit_set_min_size, OPT_INT, 1000)  // min target size for a HitSet
+OPTION(osd_hit_set_max_size, OPT_INT, 100000)  // max target size for a HitSet
 OPTION(osd_hit_set_namespace, OPT_STR, ".ceph-internal") // rados namespace for hit_set tracking
 
 OPTION(osd_tier_default_cache_mode, OPT_STR, "writeback")
index 95b61a3112246da131e2b8981090659cd230f069..675da2af910cd3206c8db18f489fff168fd0c0fd 100644 (file)
@@ -10680,6 +10680,9 @@ void ReplicatedPG::hit_set_create()
     if (p->target_size < static_cast<uint64_t>(g_conf->osd_hit_set_min_size))
       p->target_size = g_conf->osd_hit_set_min_size;
 
+    if (p->target_size > static_cast<uint64_t>(g_conf->osd_hit_set_max_size))
+      p->target_size = g_conf->osd_hit_set_max_size;
+
     p->seed = now.sec();
 
     dout(10) << __func__ << " target_size " << p->target_size