]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
bluestore: record omapiter init latency 58924/head
authorimtzw <tongzhiwei_yewu@cmss.chinamobile.com>
Tue, 30 Jul 2024 02:02:59 +0000 (02:02 +0000)
committerimtzw <tongzhiwei_yewu@cmss.chinamobile.com>
Wed, 31 Jul 2024 01:05:13 +0000 (01:05 +0000)
if one object has many `internal keys` at its omap beginning,
it maybe very slow for the underlying seek to reach the first
`user key` when initializing a omapiter.
this may stuck osd when build_push_op, seek recovering
object's first omap key again and again.

Signed-off-by: imtzw <tongzhiwei_yewu@cmss.chinamobile.com>
src/os/bluestore/BlueStore.cc

index 33581d7dabafd34c5b986e2a03fbf9598618099d..736d2be8a064f30819a3ad760a656d0272f713fe 100644 (file)
@@ -5472,7 +5472,13 @@ BlueStore::OmapIteratorImpl::OmapIteratorImpl(
   if (o->onode.has_omap()) {
     o->get_omap_key(string(), &head);
     o->get_omap_tail(&tail);
+    auto start1 = mono_clock::now();
     it->lower_bound(head);
+    c->store->log_latency(
+    __func__,
+    l_bluestore_omap_seek_to_first_lat,
+    mono_clock::now() - start1,
+    c->store->cct->_conf->bluestore_log_omap_iterator_age);
   }
 }
 BlueStore::OmapIteratorImpl::~OmapIteratorImpl()