]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fadvise hint WILL_NEED when reading encoded osdmaps
authorSage Weil <sage@redhat.com>
Thu, 25 May 2017 19:42:39 +0000 (15:42 -0400)
committerSage Weil <sage@redhat.com>
Fri, 26 May 2017 02:52:33 +0000 (22:52 -0400)
This way will ensure we cache data for recent osdmaps if we need to for
the benefit of laggy clients... even if (in bluestore's case)
bluestore_default_buffered_reads = false (it's true by default).  This
should mitigate any tail latency/work even if the osdmap cache size is too
small.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc

index 795ec29d9a093f3ba434d98eec59721713069bbe..4243893c3a1c6a922978296a7b2a24e8a5339b15 100644 (file)
@@ -1403,7 +1403,8 @@ bool OSDService::_get_map_bl(epoch_t e, bufferlist& bl)
   if (logger)
     logger->inc(l_osd_map_bl_cache_miss);
   found = store->read(coll_t::meta(),
-                     OSD::get_osdmap_pobject_name(e), 0, 0, bl) >= 0;
+                     OSD::get_osdmap_pobject_name(e), 0, 0, bl,
+                     CEPH_OSD_OP_FLAG_FADVISE_WILLNEED) >= 0;
   if (found)
     _add_map_bl(e, bl);
   return found;
@@ -1421,7 +1422,8 @@ bool OSDService::get_inc_map_bl(epoch_t e, bufferlist& bl)
   if (logger)
     logger->inc(l_osd_map_bl_cache_miss);
   found = store->read(coll_t::meta(),
-                     OSD::get_inc_osdmap_pobject_name(e), 0, 0, bl) >= 0;
+                     OSD::get_inc_osdmap_pobject_name(e), 0, 0, bl,
+                     CEPH_OSD_OP_FLAG_FADVISE_WILLNEED) >= 0;
   if (found)
     _add_map_inc_bl(e, bl);
   return found;