<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <br>
    <div class="moz-cite-prefix">On 03/23/2016 04:10 AM, Rama Shenai
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAL98fHAXC9aXRiGarYdZLuOhgttoxZEE=QMyVgTncF_ghr6sSA@mail.gmail.com"
      type="cite">
      <meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div>Hi, We had some questions with respect to expectations of
          atomicity of rename in gluster.</div>
        <div><br>
        </div>
        <div>To elaborate : </div>
        <div><br>
        </div>
        <div>We have setup with two machines (lets call them M1 and M2)
          which essentially access a file (F) on a gluster volume
          (mounted by M1 and M2)</div>
        <div>A program does the following steps sequentially on each of
          the two machines (M1 &amp; M2) in an infinite loop</div>
        <div> 1) Opens the file F in O_RDWR|O_EXCL mode, reads some data
          and closes (F)</div>
        <div> 2)  Renames some other file F' =&gt; F</div>
        <div> </div>
        <div>Periodically either M1 or M2 sees a "Stalefile handle
          error" when it tries to read the file (step (1)) after opening
          the file in O_RDWR|O_EXCL (the open is successful)</div>
        <div><br>
        </div>
        <div>The specific error reported the client volume logs
           (/var/log/glusterfs/mnt-repos-volume1.log)</div>
        <div>[2016-03-21 16:53:17.897902] I
          [dht-rename.c:1344:dht_rename] 0-volume1-dht: renaming
          master.lock
          (hash=volume1-replicate-0/cache=volume1-replicate-0) =&gt;
          master (hash=volume1-replicate-0/cache=&lt;nul&gt;)</div>
        <div>[2016-03-21 16:53:18.735090] W
          [client-rpc-fops.c:504:client3_3_stat_cbk] 0-volume1-client-0:
          remote operation failed: Stale file handle</div>
      </div>
    </blockquote>
    <br>
    Hi Rama,<br>
    <br>
    ESTALE error in rename normally generated when either the source
    file is not resolvable (deleted or inaccessible) or when the parent
    of destination is not resolvable. It can happen when let's say file
    F' was present when your application did a lookup before rename, but
    if it is got renamed by Node M1 before M2 could rename it. Basically
    a race between two rename on the same file can result in ESTALE for
    either of one.<br>
    <br>
    To confirm this, Can you please paste the log message from brick
    "0-volume1-client-0". You can find out the brick name from the
    graph.<br>
    <br>
    Also if you can share the program or snippet that used to reproduce
    this issue, that would be great.<br>
    <br>
    Rafi KC<br>
    <br>
    <br>
    <br>
    <blockquote
cite="mid:CAL98fHAXC9aXRiGarYdZLuOhgttoxZEE=QMyVgTncF_ghr6sSA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div><br>
        </div>
        <div>We see no error when: have two processes of the above
          program running on the same machine (say on M1) accessing the
          file F on the gluster volume, for which we want to understand
          the expectations of atomicity in gluster specifically
          specifically for rename, and if the above is a bug.</div>
        <div><br>
        </div>
        <div>Also  glusterfs --version =&gt; glusterfs 3.6.9 built on
          Mar  2 2016 18:21:14</div>
        <div><br>
        </div>
        <div>We also would like to know if there any parameter in the
          one translators  that we can tweak to prevent this problem</div>
        <div><br>
        </div>
        <div>Any help or insights here is appreciated</div>
        <div><br>
        </div>
        <div>Thanks</div>
        <div>Rama</div>
        <div><br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Gluster-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Gluster-users@gluster.org">Gluster-users@gluster.org</a>
<a class="moz-txt-link-freetext" href="http://www.gluster.org/mailman/listinfo/gluster-users">http://www.gluster.org/mailman/listinfo/gluster-users</a></pre>
    </blockquote>
    <br>
  </body>
</html>