Bug 1048786

Summary: quota+dht: dht is not fool proof from quota deem statfs in statfs call
Product: [Community] GlusterFS Reporter: vpshastry <vshastry>
Component: quotaAssignee: Nagaprasad Sathyanarayana <nsathyan>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: mainlineCC: bugs, gluster-bugs, nsathyan, smohan
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-3.6.0beta1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-11-11 08:26:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description vpshastry 2014-01-06 10:47:25 UTC
Description of problem:
In the normal statfs call of the DHT, all the statfs values from the subvols are aggregated in the call back. But when quota-deem-statfs is enabled quota signals it through dictionary and DHT selects one of them and sends back the same instead of aggregating. This logic doesn't work well when there is an inconsistency in the quota call back in setting the quota-deem-statfs flag. Even though we have not hit any bug, it would be better to handle these kinda error conditions.

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


How reproducible:
Always

Steps to Reproduce:
Add any logic in the quota_statfs_cbk so that only few of the bricks send the quota-deem-statfs flag in the call back. And execute df command from the shell or call statfs from any code.

Actual results:


Expected results:
Statfs call values should not be skewed from the actual backend values or quota values if quota-deem-statfs is on.

Additional info:

Comment 1 Anand Avati 2014-01-06 10:52:28 UTC
REVIEW: http://review.gluster.org/6652 (features/quota: Make dht_statfs_cbk more fool proof from quota_deem_statfs) posted (#1) for review on master by Varun Shastry (vshastry)

Comment 2 Anand Avati 2014-01-20 07:32:41 UTC
REVIEW: http://review.gluster.org/6652 (features/quota: Make dht_statfs_cbk more fool proof from quota_deem_statfs) posted (#2) for review on master by Varun Shastry (vshastry)

Comment 3 Anand Avati 2014-01-24 09:21:43 UTC
REVIEW: http://review.gluster.org/6652 (features/quota: Make dht_statfs_cbk more fool proof from quota_deem_statfs) posted (#3) for review on master by Varun Shastry (vshastry)

Comment 4 Anand Avati 2014-01-24 10:30:58 UTC
REVIEW: http://review.gluster.org/6652 (features/quota: Make dht_statfs_cbk more fool proof from quota_deem_statfs) posted (#4) for review on master by Varun Shastry (vshastry)

Comment 5 Anand Avati 2014-02-11 09:54:45 UTC
REVIEW: http://review.gluster.org/6652 (features/quota: Make dht_statfs_cbk more fool proof from quota_deem_statfs) posted (#5) for review on master by Varun Shastry (vshastry)

Comment 6 Anand Avati 2014-05-29 12:19:13 UTC
REVIEW: http://review.gluster.org/6652 (features/quota: Make dht_statfs_cbk more fool proof from quota_deem_statfs) posted (#6) for review on master by Varun Shastry (vshastry)

Comment 7 Anand Avati 2014-06-02 09:27:01 UTC
REVIEW: http://review.gluster.org/6652 (features/quota: Make dht_statfs_cbk more fool proof from quota_deem_statfs) posted (#7) for review on master by Varun Shastry (vshastry)

Comment 8 Anand Avati 2014-06-18 16:50:40 UTC
COMMIT: http://review.gluster.org/6652 committed in master by Raghavendra G (rgowdapp) 
------
commit b54764ba860c3baba4b441ae7fcf043ab7eb46db
Author: Varun Shastry <vshastry>
Date:   Thu Dec 26 15:30:49 2013 +0530

    features/quota: Make dht_statfs_cbk more fool proof from quota_deem_statfs
    
    Problem:
    The function depends on the fact that if quota-deem-statfs option is enabled,
    all of the subvolumes send their xdata with quota-deem-statfs flag ON. But,
    this may not be true in case of errors in some of the subvolumes.
    
    There is a decision/policy made which assumes quota-deem-statfs to be ON if at
    least ONE of the subvolumes sends the flag ON. By this, df reports quota
    modified statfs values if *at least ONE* of the bricks sends the
    quota-deem-statfs flag ON. This can be visualized with the below "Transition
    Diagram/State Machine".
    
            Event: Each Quota deem statfs status from the individual bricks
            Action: Decision taken on the calculation of the statvfs received
            State: Whether quota deem statfs is ON or OFF (0: OFF, 1: ON)
            Input: Event from individual bricks
    
                  ___                  ___
                 /   \   OFF*         /   \  (OFF|ON)*
                |     |              |     |
                 \   /        ON      \   /
            -----> 0  ----------------> 1
    
    The below Transition Function depicts the relation between the statfs
    calculation based on the events received.
    
             State          Event          action
            -------------------------------------
              OFF            OFF            OFF
              OFF            ON            REPLACE
              ON             OFF           NEGLECT
              ON             ON            COMPARE
    
    Change-Id: I0e8fb7d3945a3ca3dde0bb99de6cd397e27a3162
    BUG: 1048786
    Signed-off-by: Varun Shastry <vshastry>
    Reviewed-on: http://review.gluster.org/6652
    Reviewed-by: Krishnan Parthasarathi <kparthas>
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Raghavendra G <rgowdapp>
    Tested-by: Raghavendra G <rgowdapp>

Comment 11 Niels de Vos 2014-09-22 12:34:35 UTC
A beta release for GlusterFS 3.6.0 has been released. Please verify if the release solves this bug report for you. In case the glusterfs-3.6.0beta1 release does not have a resolution for this issue, leave a comment in this bug and move the status to ASSIGNED. If this release fixes the problem for you, leave a note and change the status to VERIFIED.

Packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update (possibly an "updates-testing" repository) infrastructure for your distribution.

[1] http://supercolony.gluster.org/pipermail/gluster-users/2014-September/018836.html
[2] http://supercolony.gluster.org/pipermail/gluster-users/

Comment 12 Niels de Vos 2014-11-11 08:26:32 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.6.1, please reopen this bug report.

glusterfs-3.6.1 has been announced [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://supercolony.gluster.org/pipermail/gluster-users/2014-November/019410.html
[2] http://supercolony.gluster.org/mailman/listinfo/gluster-users