<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 02/28/2014 07:28 AM, Zhang Huan
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAM8aEsEHzWM+7pm-gKQUNMB-Hx8rJ7B5GUDa0-nqqdAyYbEw_w@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_default"
          style="font-family:arial,helvetica,sans-serif">Hello <span
            style="font-family:arial,sans-serif;font-size:13px">Ravi,</span></div>
        <div class="gmail_default"
          style="font-family:arial,helvetica,sans-serif">
          <span style="font-family:arial,sans-serif;font-size:13px"><br>
          </span></div>
        <div class="gmail_default"
          style="font-family:arial,helvetica,sans-serif"><span
            style="font-family:arial,sans-serif;font-size:13px">Thanks
            for your reply.</span></div>
        <div class="gmail_default"
          style="font-family:arial,helvetica,sans-serif"><span
            style="font-family:arial,sans-serif;font-size:13px"><br>
          </span></div>
        <div class="gmail_default"
          style="font-family:arial,helvetica,sans-serif">
          <span style="font-family:arial,sans-serif;font-size:13px">Sorry
            that I have a typo in my mail. It should by "underlying
            corruption" instead of "underlying correction".</span></div>
        <div class="gmail_default"
          style="font-family:arial,helvetica,sans-serif">
          <br>
        </div>
        <div class="gmail_default"><font face="arial, sans-serif">I
            guess the logic of eliminating zero byte files from all
            innocent nodes is working for preventing underlying
            corruption to propagate to other brick. Asked in another
            way, if the underlying brick finds some file is corrupted,
            anything it could do to tell glusterfs to fix it?</font></div>
        <div class="gmail_default"
          style="font-family:arial,helvetica,sans-serif"><span
            style="font-family:arial,sans-serif;font-size:13px"><br>
          </span></div>
      </div>
    </blockquote>
    Hi Zhang,<br>
    If all nodes are innocent (from AFR's point of view) ,then AFR
    cannot  use the changelog attributes to determine which is source.
    In this case, the safest bet is to mark all zero byte files as sink,
    so that we don't end up healing in the wrong direction.  Like I said
    earlier, AFR can only use the changelog attributes (xattrs) to
    determine the source/sinks. It cannot detect underlying on disk file
    system corruptions outside the scope of the xattrs. <br>
    <br>
    If you are sure that a particular brick is the right source despite
    the xattrs saying otherwise, you can manually change the attributes
    of the file on all bricks so that AFR now sees that brick as the
    source and heals in the expected direction.<br>
    <br>
    -Ravi<br>
    <br>
    <blockquote
cite="mid:CAM8aEsEHzWM+7pm-gKQUNMB-Hx8rJ7B5GUDa0-nqqdAyYbEw_w@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_default"
          style="font-family:arial,helvetica,sans-serif">
          <span style="font-family:arial">Zhang Huan</span><br>
        </div>
        <div class="gmail_extra">
          <br>
          <br>
          <div class="gmail_quote">On Thu, Feb 27, 2014 at 7:50 PM,
            Ravishankar N <span dir="ltr">&lt;<a moz-do-not-send="true"
                href="mailto:ravishankar@redhat.com" target="_blank">ravishankar@redhat.com</a>&gt;</span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
              <div bgcolor="#FFFFFF" text="#000000">
                <div class="">
                  <div>On 02/26/2014 07:42 PM, Zhang Huan wrote:<br>
                  </div>
                  <blockquote type="cite">
                    <div dir="ltr">
                      <div
                        style="font-family:arial,helvetica,sans-serif">Hello
                        guys,</div>
                      <div
                        style="font-family:arial,helvetica,sans-serif"><br>
                      </div>
                      <div
                        style="font-family:arial,helvetica,sans-serif">
                        Anyone know about my question?</div>
                    </div>
                    <div class="gmail_extra"><br clear="all">
                      <div>Zhang Huan</div>
                      <br>
                      <br>
                      <div class="gmail_quote">On Sun, Feb 23, 2014 at
                        11:28 AM, Zhang Huan <span dir="ltr">&lt;<a
                            moz-do-not-send="true"
                            href="mailto:zhhuan@gmail.com"
                            target="_blank">zhhuan@gmail.com</a>&gt;</span>
                        wrote:<br>
                        <blockquote class="gmail_quote"
                          style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
                          <div dir="ltr">
                            <div
                              style="font-family:arial,helvetica,sans-serif">Hello

                              all,</div>
                            <div
                              style="font-family:arial,helvetica,sans-serif"><br>
                            </div>
                            <div
                              style="font-family:arial,helvetica,sans-serif">
                              While reading codes about how to choose
                              healing source, there is one thing that
                              confuse me. Say we have 3 replica, and 2
                              of them are OK and the left one is
                              outdated due to temporary IO failure. For
                              some reason, one of the 2 correct replica
                              is truncated to 0 due to some underlying
                              correction. Will glusterfs kick the 0 size
                              file out? or still consider it a correct
                              one and may corrupt the left correct
                              replica by healing?</div>
                            <br>
                          </div>
                        </blockquote>
                      </div>
                    </div>
                  </blockquote>
                </div>
                Out of the two correct replicas, gluster will pick the
                first healthy replica brick as source [see
                afr_sh_select_source()]. If that brick is truncated at
                the back-end due to 'underlying correction' (not sure
                what that means), then yes I'm afraid it will still be
                considered as correct source and you would get zero byte
                file in other 2 bricks because of the healing.
                <div class=""><br>
                  <blockquote type="cite">
                    <div class="gmail_extra">
                      <div class="gmail_quote">
                        <blockquote class="gmail_quote"
                          style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
                          <div dir="ltr">
                            <div
                              style="font-family:arial,helvetica,sans-serif">In

                              function afr_mark_sources(), it kicks 0
                              size file out when all nodes are innocent.
                              Even when all nodes are fools, the file
                              with largest size will be chosen as
                              source. When it comes to the case that
                              there is wise nodes, it won't further
                              check file size. Considering different
                              file size of replicate will trigger
                              healing to work, I am wondering if there
                              is any reason behind the code?</div>
                          </div>
                        </blockquote>
                      </div>
                    </div>
                  </blockquote>
                </div>
                The changelog extended attributes are marked  by AFR
                based on the result of whether the file operation
                succeeded or not on each of the replica. It uses those
                attributes to determine the source/sink. Direct
                modification of the file at the brick will invalidate
                any meaning that the changelog holds.<br>
                Thanks,<br>
                Ravi
                <div class=""><br>
                  <blockquote type="cite">
                    <div class="gmail_extra">
                      <div class="gmail_quote">
                        <blockquote class="gmail_quote"
                          style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
                          <div dir="ltr">
                            <div
                              style="font-family:arial,helvetica,sans-serif"><br>
                            </div>
                            <div
                              style="font-family:arial,helvetica,sans-serif">Thanks.</div>
                            <span><font color="#888888">
                                <div
                                  style="font-family:arial,helvetica,sans-serif">
                                  <br>
                                </div>
                                <div>Zhang Huan</div>
                              </font></span></div>
                        </blockquote>
                      </div>
                      <br>
                    </div>
                    <br>
                    <fieldset></fieldset>
                    <br>
                    <pre>_______________________________________________
Gluster-devel mailing list
<a moz-do-not-send="true" href="mailto:Gluster-devel@nongnu.org" target="_blank">Gluster-devel@nongnu.org</a>
<a moz-do-not-send="true" href="https://lists.nongnu.org/mailman/listinfo/gluster-devel" target="_blank">https://lists.nongnu.org/mailman/listinfo/gluster-devel</a>
</pre>
                  </blockquote>
                  <br>
                </div>
              </div>
            </blockquote>
          </div>
          <br>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>