All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Dillaman <jdillama@redhat.com>
To: xxhdx1985126 <xxhdx1985126@163.com>
Cc: "ceph-devel@vger.kernel.org" <ceph-devel@vger.kernel.org>
Subject: Re: How does rbd-mirror preserve the order of WRITE operations that finished on the primary cluster
Date: Mon, 5 Jun 2017 08:00:06 -0400	[thread overview]
Message-ID: <CA+aFP1B=M97rVtGcY=v79zg_2rS=+NNcO5FTT32yLCZtky7N7g@mail.gmail.com> (raw)
In-Reply-To: <70c5c552.66e6.15c766dce68.Coremail.xxhdx1985126@163.com>

The order of writes from a single client connection to a single OSD is
guaranteed. The rbd-mirror journal replay process handles one event at
a time and does not start processing the next event until the IO has
been started in-flight with librados. Therefore, even though the
replay process allows 50 - 100 IO requests to be in-flight, those IOs
are actually well-ordered in terms of updates to a single object.

Of course, such an IO request from the client application / VM would
be incorrect behavior if they didn't wait for the completion callback
before issuing the second update.

On Mon, Jun 5, 2017 at 12:05 AM, xxhdx1985126 <xxhdx1985126@163.com> wrote:
> Hi, everyone.
>
>
> Recently, I've been reading the source code of rbd-mirror. I wonder how rbd-mirror preserves the order of WRITE operations that finished on the primary cluster. As far as I can understand the code, rbd-mirror fetches I/O operations from the journal on the primary cluster, and replay them on the slave cluster without checking whether there's already any I/O operations targeting the same object that has been issued to the slave cluster and not yet finished. Since concurrent operations may finish in a different order than that in which they arrived at the OSD, the order that the WRITE operations finish on the slave cluster may be different than that on the primay cluster. For example: on the primary cluster, there are two WRITE operation targeting the same object A which are, in the order t
 hey finish on the primary cluster, "WRITE A.off data1" and "WRITE A.off data2"; while when they are replayed on the slave cluster, the order may be "WRITE A.off data2" and "WRITE A.off data1", which means that the result of the two operations on the primary cluster is A.off=data2 while, on the slave cluster, the result is A.off=data1.
>
>
> Is this possible?
>
>
>



-- 
Jason

  reply	other threads:[~2017-06-05 12:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-05  4:05 How does rbd-mirror preserve the order of WRITE operations that finished on the primary cluster xxhdx1985126
2017-06-05 12:00 ` Jason Dillaman [this message]
2017-06-05 15:49   ` xxhdx1985126
2017-06-05 16:21     ` Sage Weil
     [not found]       ` <428d3e79.3d2.15c7a56a64f.Coremail.xxhdx1985126@163.com>
2017-06-05 22:22         ` Sage Weil
2017-06-05 22:50           ` xxhdx1985126
2017-06-06  3:04             ` xxhdx1985126
2017-06-06  3:13               ` Haomai Wang
2017-06-06  4:05                 ` xxhdx1985126
2017-06-06  7:34                   ` xxhdx1985126
2017-06-06  7:40                   ` xxhdx1985126
2017-06-06  7:49                     ` Haomai Wang
2017-06-06  8:07                       ` xxhdx1985126
2017-06-06 11:20                         ` Jason Dillaman
2017-06-14  2:03                           ` xxhdx1985126
     [not found]             ` <47d3f4bc.3a4b.15c7b3fceb0.Coremail.xxhdx1985126@163.com>
2017-06-06 14:01               ` Sage Weil
2017-06-07 15:36                 ` xxhdx1985126
2017-06-07 15:42                 ` xxhdx1985126

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+aFP1B=M97rVtGcY=v79zg_2rS=+NNcO5FTT32yLCZtky7N7g@mail.gmail.com' \
    --to=jdillama@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=dillaman@redhat.com \
    --cc=xxhdx1985126@163.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.