]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
osd/PrimaryLogPG: fix potential pg-log overtrimming 24308/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 30 Jul 2018 10:56:56 +0000 (18:56 +0800)
committerNeha Ojha <nojha@redhat.com>
Thu, 27 Sep 2018 17:39:29 +0000 (13:39 -0400)
commit85a029a7242a1c6eef4e90ae246541e08207302a
tree9eabae1a69efedbb8df6698402d9b84e2c4c4662
parent3b8fc8893158318fd41a9367abe4b3679a494966
osd/PrimaryLogPG: fix potential pg-log overtrimming

In https://github.com/ceph/ceph/pull/21580 I set a trap to catch some wired
and random segmentfaults and in a recent QA run I was able to observe it was
successfully triggered by one of the test case, see:

```
http://qa-proxy.ceph.com/teuthology/xxg-2018-07-30_05:25:06-rados-wip-hb-peers-distro-basic-smithi/2837916/teuthology.log
```

The root cause is that there might be holes on log versions, thus the
approx_size() method should (almost) always overestimate the actual number of log entries.
As a result, we might be at the risk of overtrimming log entries.

https://github.com/ceph/ceph/pull/18338 reveals a probably easier way
to fix the above problem but unfortunately it also can cause big performance regression
and hence comes this pr..

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
(cherry picked from commit 3654d56985c67d15506fa37b56ef5b0c04e01a65)

Conflicts:
src/osd/PrimaryLogPG.cc: trivial resolution
src/osd/PrimaryLogPG.cc