]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix memory leak at EC read 22500/head
authorcuixf <cuixiaofei@sangfor.com.cn>
Mon, 11 Jun 2018 02:06:42 +0000 (22:06 -0400)
committerningtao63358 <ningtao@sangfor.com>
Mon, 11 Jun 2018 02:07:27 +0000 (22:07 -0400)
Clean the in_progess and shard_to_read_map when the read op is complete,
to prevent memory leak and primary osd crash.

Signed-off-by: xiaofei cui <cuixiaofei@sangfor.com>
src/osd/ECBackend.cc

index 151e35e41416857ce74d990ccd87fa1ff0c9b9ab..1bf6464f5f9bc064b3648efe3a61f9b561d71c38 100644 (file)
@@ -1257,6 +1257,13 @@ void ECBackend::complete_read_op(ReadOp &rop, RecoveryMessages *m)
       reqiter->second.cb = nullptr;
     }
   }
+  // if the read op is over. clean all the data of this tid.
+  for (set<pg_shard_t>::iterator iter = rop.in_progress.begin();
+    iter != rop.in_progress.end();
+    iter++) {
+    shard_to_read_map[*iter].erase(rop.tid);
+  }
+  rop.in_progress.clear();
   tid_to_read_map.erase(rop.tid);
 }