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>
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);
}