Query regards to take decision about hashed_subvol to heal user xattr

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

 



Hi All,

 I have used below approach to heal custom xattr(user,acl,quota) in patch(https://review.gluster.org/#/c/15468/) to know about hashed_subvol that is required to first wind a fop(setxattr) on hashed_subvol then try to update the same on other subvols. 

 In dht_revalidate/lookup_cbk i do save hashed_subvolume on inode_ctx and at the time of set xattr(dht_setxattr) call function dht_inode_ctx_hashvol_get to know about the saved hashed_subvol.

1) First it will check stored hashed_subvol(after call the function dht_inode_ctx_hashvol_get) on a inode and 
    save status in ret variable.

2) If ret is 0 (means hashed_subvol exists in inode) then it will check the status of hashed_subvol 
       if it is up then set the index into fop_wind(variable) and break out from the loop
       If it(status) is down in that case it will set ret value to 1 and check next up  subvol and set index into fop_wind.
 
    If hash_subvol index exist in last of array in that case it will set index in fop_wind of previous up subvolume. 

3) if ret is not 0 (means hashed_subvol does not exist in the inode) then it will set index to last up subvol and break out from the  loop.

Below is the code to take decision about hashed_subvolume in dht_setxattr

>>>>>>>>>>>>>>>>>>>>>>

ret = dht_inode_ctx_hashvol_get (loc->inode, this,
                                                 &hashed_subvol);  
for (i = 0; i < call_cnt; i++) {
                        if (!ret && conf->subvolumes[i] == hashed_subvol) {
                                if (!conf->subvolume_status[i]) {
                                        gf_msg(this->name, GF_LOG_WARNING, 0,
                                               DHT_MSG_HASHED_SUBVOL_DOWN,
                                               "hash subvolume %s is down "
                                               "for path %s",
                                               hashed_subvol->name, loc->path);
                                        ret = 1;
                                } else {
                                        fop_wind = i;
                                        break;
                                }
                         } else {
                                if (conf->subvolume_status[i])
                                        fop_wind = i;
                          } 
 }


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


Please share your input if any issue in this approach to decide about hashed_subvolume.
Appreciate your inputs.

Regards
Mohit Agrawal

_______________________________________________
Gluster-devel mailing list
Gluster-devel@xxxxxxxxxxx
http://lists.gluster.org/mailman/listinfo/gluster-devel

[Index of Archives]     [Gluster Users]     [Ceph Users]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux