On Mon, Dec 3, 2018 at 1:50 PM Dongsheng Yang <dongsheng.yang@xxxxxxxxxxxx> wrote: > > Hi all, > This is V1 to implement the journaling feature in kernel rbd, which makes mirroring in kubernetes possible. > It passed the /ceph/ceph/qa/workunits/rbd/rbd_mirror.sh, with a little change as below: > > ``` > [root@atest-guest build]# git diff /ceph/ceph/qa/workunits/rbd/rbd_mirror_helpers.sh > diff --git a/qa/workunits/rbd/rbd_mirror_helpers.sh b/qa/workunits/rbd/rbd_mirror_helpers.sh > index e019de5..9d00d3e 100755 > --- a/qa/workunits/rbd/rbd_mirror_helpers.sh > +++ b/qa/workunits/rbd/rbd_mirror_helpers.sh > @@ -854,9 +854,9 @@ write_image() > > test -n "${size}" || size=4096 > > - rbd --cluster ${cluster} -p ${pool} bench ${image} --io-type write \ > - --io-size ${size} --io-threads 1 --io-total $((size * count)) \ > - --io-pattern rand > + rbd --cluster ${cluster} -p ${pool} map ${image} > + fio --name=test --rw=randwrite --bs=${size} --runtime=60 --ioengine=libaio --iodepth=1 --numjobs=1 --filename=/dev/rbd0 --direct=1 --group_reporting --size $((size * count)) --group_reporting --eta-newline 1 > + rbd --cluster ${cluster} -p ${pool} unmap ${image} > } > > stress_write_image() > ``` > > Changelog from RFC: > 1. error out if there is some unsupported event type in replaying So the journal is still replayed in the kernel. Was there a design discussion about this? Like I said in one of my replies to the RFC, I think we should avoid replaying the journal in the kernel and try to come up with a design where it's done by librbd. The fundamental problem with replaying the journal in the kernel and therefore supporting only a couple of event types is that the journal has to be replayed not only at "rbd map" time, but also every time the exclusive lock is reacquired. Whereas we can safely error out at "rbd map" time, I don't see a sane way to handle a case where an unsupported event type is encountered after reacquiring the lock when the image is already mapped. Thanks, Ilya