Bug 1219075 - Named lookup heal of pre-existing files, before ctr was ON
Summary: Named lookup heal of pre-existing files, before ctr was ON
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: tiering
Version: 3.7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: bugs@gluster.org
QA Contact: bugs@gluster.org
URL:
Whiteboard:
Depends On:
Blocks: 1260923
TreeView+ depends on / blocked
 
Reported: 2015-05-06 14:19 UTC by Joseph Elwin Fernandes
Modified: 2016-06-20 00:01 UTC (History)
3 users (show)

Fixed In Version: glusterfs-3.7.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-05-14 17:29:38 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Joseph Elwin Fernandes 2015-05-06 14:19:17 UTC
Description of problem:

Problem: The CTR xlator records file meta (heat/hardlinks)
into the data. This works fine for files which are created
after ctr xlator is switched ON. But for files which were
created before CTR xlator is ON, CTR xlator is not able to
record either of the meta i.e heat or hardlinks. Thus making
those files immune to promotions/demotions.
Solution: The solution that is implemented in this patch is
do ctr-db heal of all those pre-existent files, using named lookup.
For this purpose we use the inode-xlator context variable option
in gluster.
The inode-xlator context variable for ctr xlator will have the
following,
    a. A Lock for the context variable
    b. A hardlink list: This list represents the successful looked
       up hardlinks.
These are the scenarios when the hardlink list is updated:
1) Named-Lookup: Whenever a named lookup happens on a file, in the
   wind path we copy all required hardlink and inode information to
   ctr_db_record structure, which resides in the frame->local variable.
   We dont update the database in wind. During the unwind, we read the
   information from the ctr_db_record and ,
   Check if the inode context variable is created, if not we create it.
   Check if the hard link is there in the hardlink list.
      If its not there we add it to the list and send a update to the
      database using libgfdb.
      Please note: The database transaction can fail(and we ignore) as there
      already might be a record in the db. This update to the db is to heal
      if its not there.
      If its there in the list we ignore it.
2) Inode Forget: Whenever an inode forget hits we clear the hardlink list in
   the inode context variable and delete the inode context variable.
   Please note: An inode forget may happen for two reason,
   a. when the inode is delete.
   b. the in-memory inode is evicted from the inode table due to cache limits.
3) create: whenever a create happens we create the inode context variable and
   add the hardlink. The database updation is done as usual by ctr.
4) link: whenever a hardlink is created for the inode, we create the inode context
   variable, if not present, and add the hardlink to the list.
5) unlink: whenever a unlink happens we delete the hardlink from the list.
6) mknod: same as create.
7) rename: whenever a rename happens we update the hardlink in list. if the hardlink
   was not present for updation, we add the hardlink to the list.
What is pending:
1) This solution will only work for named lookups.
2) We dont track afr-self-heal/dht-rebalancer traffic for healing.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Anand Avati 2015-05-06 14:21:23 UTC
REVIEW: http://review.gluster.org/10615 (ctr/xlator: Named lookup heal of pre-existing files, before ctr was ON.) posted (#1) for review on release-3.7 by Joseph Fernandes (josferna)

Comment 2 Anand Avati 2015-05-07 06:06:30 UTC
REVIEW: http://review.gluster.org/10615 (ctr/xlator: Named lookup heal of pre-existing files, before ctr was ON.) posted (#2) for review on release-3.7 by Joseph Fernandes (josferna)

Comment 3 Anand Avati 2015-05-07 06:08:20 UTC
REVIEW: http://review.gluster.org/10615 (ctr/xlator: Named lookup heal of pre-existing files, before ctr was ON.) posted (#3) for review on release-3.7 by Joseph Fernandes (josferna)

Comment 4 Anand Avati 2015-05-08 07:34:45 UTC
COMMIT: http://review.gluster.org/10615 committed in release-3.7 by Vijay Bellur (vbellur) 
------
commit 268b7fcb307e14cce5bcd28495f24333710ba82c
Author: Joseph Fernandes <josferna>
Date:   Fri Apr 24 19:22:44 2015 +0530

    ctr/xlator: Named lookup heal of pre-existing files, before ctr was ON.
    
    Problem: The CTR xlator records file meta (heat/hardlinks)
    into the data. This works fine for files which are created
    after ctr xlator is switched ON. But for files which were
    created before CTR xlator is ON, CTR xlator is not able to
    record either of the meta i.e heat or hardlinks. Thus making
    those files immune to promotions/demotions.
    
    Solution: The solution that is implemented in this patch is
    do ctr-db heal of all those pre-existent files, using named lookup.
    For this purpose we use the inode-xlator context variable option
    in gluster.
    The inode-xlator context variable for ctr xlator will have the
    following,
        a. A Lock for the context variable
        b. A hardlink list: This list represents the successful looked
           up hardlinks.
    These are the scenarios when the hardlink list is updated:
    1) Named-Lookup: Whenever a named lookup happens on a file, in the
       wind path we copy all required hardlink and inode information to
       ctr_db_record structure, which resides in the frame->local variable.
       We dont update the database in wind. During the unwind, we read the
       information from the ctr_db_record and ,
       Check if the inode context variable is created, if not we create it.
       Check if the hard link is there in the hardlink list.
          If its not there we add it to the list and send a update to the
          database using libgfdb.
          Please note: The database transaction can fail(and we ignore) as there
          already might be a record in the db. This update to the db is to heal
          if its not there.
          If its there in the list we ignore it.
    2) Inode Forget: Whenever an inode forget hits we clear the hardlink list in
       the inode context variable and delete the inode context variable.
       Please note: An inode forget may happen for two reason,
       a. when the inode is delete.
       b. the in-memory inode is evicted from the inode table due to cache limits.
    3) create: whenever a create happens we create the inode context variable and
       add the hardlink. The database updation is done as usual by ctr.
    4) link: whenever a hardlink is created for the inode, we create the inode context
       variable, if not present, and add the hardlink to the list.
    5) unlink: whenever a unlink happens we delete the hardlink from the list.
    6) mknod: same as create.
    7) rename: whenever a rename happens we update the hardlink in list. if the hardlink
       was not present for updation, we add the hardlink to the list.
    
    What is pending:
    1) This solution will only work for named lookups.
    2) We dont track afr-self-heal/dht-rebalancer traffic for healing.
    
    > http://review.gluster.org/#/c/10370/
    > Cherry picked from commit cb11dd91a6cc296e4a3808364077f4eacb810e48
    > Change-Id: Ia4bbaf84128ad6ce8c3ddd70bcfa82894c79585f
    > BUG: 1212037
    > Signed-off-by: Joseph Fernandes <josferna>
    > Signed-off-by: Dan Lambright <dlambrig>
    > Reviewed-on: http://review.gluster.org/10370
    > Reviewed-by: Jeff Darcy <jdarcy>
    > Tested-by: Gluster Build System <jenkins.com>
    > Tested-by: NetBSD Build System
    > Reviewed-by: Vijay Bellur <vbellur>
    
    Change-Id: I367aa46c3f4b8f912248fb8be75866507f2538df
    BUG: 1219075
    Signed-off-by: Joseph Fernandes <josferna>
    Signed-off-by: Dan Lambright <dlambrig>
    Reviewed-on: http://review.gluster.org/10370
    Reviewed-by: Jeff Darcy <jdarcy>
    Reviewed-by: Vijay Bellur <vbellur>
    Signed-off-by: Joseph Fernandes <josferna>
    Reviewed-on: http://review.gluster.org/10615
    Tested-by: Vijay Bellur <vbellur>

Comment 5 Niels de Vos 2015-05-14 17:29:38 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.7.0, please open a new bug report.

glusterfs-3.7.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user

Comment 6 Niels de Vos 2015-05-14 17:36:00 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.7.0, please open a new bug report.

glusterfs-3.7.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user

Comment 7 Niels de Vos 2015-05-14 17:38:22 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.7.0, please open a new bug report.

glusterfs-3.7.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user

Comment 8 Niels de Vos 2015-05-14 17:47:22 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.7.0, please open a new bug report.

glusterfs-3.7.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10939
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user


Note You need to log in before you can comment on or make changes to this bug.