gluster-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gluster-devel] Fail when calling syncop_create


From: Anand Avati
Subject: Re: [Gluster-devel] Fail when calling syncop_create
Date: Sun, 9 Sep 2012 11:09:25 -0700



On Sun, Sep 9, 2012 at 10:53 AM, Gustavo Bervian Brand <address@hidden> wrote:
Hello,

  I'm implementing a translator and at the moment I'm trying to "cache" at the local node's disk the files read from other node. 
  When reading a file from a certain node, at the file open function it's added an extended metadata at the original file with info about where this file (or part of it) is copied, calling syncop_setxattr to the proper child to do it.
  So, once open is done the readv comes and if this file was not already read/cached, at the readv_cbk (before stack unwind) I am trying to create a local file with the content got from the original node.

  For that purpose, I am using syncop_create / setattr / write. But the syncop_create is always failing with Stale NFS file handle error.
  I tried to copy the same gfid and pargfid of the loc_t used at open function (saved), it didn't work, tried to zero them, nothing... and manipulated all the variables used at the syncop_create call... but nothing worked to get a success return from syncop_create.

  Is there some requirement to call syncop_create, or a good way to track the exact reason for this failure (I could see it's not even reaching the client_create() call through gdb)? I am using the code from the master branch of 1 week ago. Any comment is welcome. 


Part of the log:

[2012-09-09 17:04:16.357875] I [gbfs_t.c:361:gbfs_open_cbk] 0-gbfs-test: entering gbfs_open_cbk function
[2012-09-09 17:04:16.358026] I [gbfs_t.c:169:gbfs_readv] 0-gbfs-test: entering gbfs_readv function
[2012-09-09 17:04:16.358156] I [gbfs_t.c:46:gbfs_readv_cbk] 0-gbfs-test: entering gbfs_readv_cbk function
[2012-09-09 17:04:16.358192] I [gbfs_t.c:132:gbfs_readv_cbk] 0-gbfs-test: failed to create /35a710dd on examplevol-client-0 (Stale NFS file handle)


It will be good to put a break-point at gbfs_readv_cbk to inspect the backtrace to find which layer did the STACK_UNWIND(..,ESTALE...); and continue debugging from there.

For a create, you are expected to:
- fill loc.pargfid
- fill loc.basename
- fill loc.inode (obtained via inode_new())
- fill "gfid-req" key in xdata dictionary with a GFID to be assigned for the newly created file.

You can inspect posix_create() and client_create() to double check what the "dependencies" are. Note that if what you are creating is just a cached version of the original file, then it might be a good idea to re-use its gfid too.

Avati


reply via email to

[Prev in Thread] Current Thread [Next in Thread]