[Gluster-devel] trash.t failure

Kinglong Mee kinglongmee at gmail.com
Wed Apr 18 10:37:37 UTC 2018


I find the problem that causes trash.t lookup get -ENOENT.
For the trash created file /path/of/test/.trashcan/file2_2018-04-18_093744.

Without this patch, in posix_create, the gfid is not set; the gfid will be set in the following posix_lookup by posix_gfid_heal.

With this patch, between posix_create and posix_lookup, posix_readdirp appears,
which sets parent's gfid to the file, and file's ctime is updated correspondingly.

In the following posix_lookup posix_gfid_heal call is_fresh_file checking ctime of the file,
it considers the file as fresh for posix_readdirp updates the ctime in one seconds,
so that don't update the gfid and return -ENOENT.

static int
is_fresh_file (struct stat *stat)
{
        struct timeval tv;

        gettimeofday (&tv, NULL);

        if ((stat->st_ctime >= (tv.tv_sec - 1))
            && (stat->st_ctime <= tv.tv_sec)) {
                assert (0);
                return 1;
         }

        return 0;
}
int
posix_gfid_heal (xlator_t *this, const char *path, loc_t *loc, dict_t *xattr_req)
{
 ......
        ret = sys_lgetxattr (path, GFID_XATTR_KEY, uuid_curr, 16);
        if (ret != 16) {
                if (is_fresh_file (&stat)) {
                        return -ENOENT;
                }
        }
 ......
}

thanks,
Kinglong Mee

On 2018/4/18 14:49, Atin Mukherjee wrote:
> 
> On Wed, 18 Apr 2018 at 10:43, Nigel Babu <nigelb at redhat.com <mailto:nigelb at redhat.com>> wrote:
> 
>     I've reverted the original patch entirely. Our policy is to either mark the test as bad or revert the entire patch. This seems to have caused multiple failures in the test system, so I've reverted the entire patch. Please re-land the patch with any fixes as a fresh review.
> 
> 
> Thanks Nigel.
> 
> The patches waiting on the regression queue need to be rebased. Only doing a ‘recheck centos’ is not going to be helpful.
> 
> 
> 
>     On Wed, Apr 18, 2018 at 8:25 AM, Atin Mukherjee <amukherj at redhat.com <mailto:amukherj at redhat.com>> wrote:
> 
>         commit d206fab73f6815c927a84171ee9361c9b31557b1
>         Author: Kinglong Mee <mijinlong at open-fs.com <mailto:mijinlong at open-fs.com>>
>         Date:   Mon Apr 9 08:33:51 2018 -0400
> 
>             storage/posix: add pgfid in readdirp if needed
>            
>             Change-Id: I6745428fd9d4e402bf2cad52cee8ab46b7fd822f
>             fixes: bz#1560319
>             Signed-off-by: Kinglong Mee <mijinlong at open-fs.com <mailto:mijinlong at open-fs.com>>
> 
> 
>         The above commit has caused (thanks to Amar for bisect!) trash.t test in upstream CI to fail very frequently. As per fstat.gluster.org <http://fstat.gluster.org> (refer :https://bit.ly/2qGcSP6) this test has failed 17 times in master branch in last 4 days. Given we're nearing GlusterFS 4.1 branching and there're few important patches blocked in the regression pipeline queue, I've sent a patch https://review.gluster.org/19894  to mark trash.t as bad for now as a temporary arrangement.
> 
>         I request Kinglong and the owner of trash feature to debug this issue and send a fix which can revert back my change.
> 
> 
>         _______________________________________________
>         Gluster-devel mailing list
>         Gluster-devel at gluster.org <mailto:Gluster-devel at gluster.org>
>         http://lists.gluster.org/mailman/listinfo/gluster-devel
> 
> 
> 
> 
>     -- 
>     nigelb
> 
> -- 
> - Atin (atinm)
> 
> 
> _______________________________________________
> Gluster-devel mailing list
> Gluster-devel at gluster.org
> http://lists.gluster.org/mailman/listinfo/gluster-devel
> 


More information about the Gluster-devel mailing list