Bug 1444515 - [GNFS+EC] Unable to release the lock when the other client tries to acquire the lock on the same file
Summary: [GNFS+EC] Unable to release the lock when the other client tries to acquire t...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat Storage
Component: disperse
Version: rhgs-3.3
Hardware: Unspecified
OS: Unspecified
urgent
unspecified
Target Milestone: ---
: RHGS 3.3.0
Assignee: Ashish Pandey
QA Contact: Manisha Saini
URL:
Whiteboard:
Depends On: 1455049 1462121
Blocks: 1411338 1417151
TreeView+ depends on / blocked
 
Reported: 2017-04-21 13:40 UTC by Manisha Saini
Modified: 2017-09-21 04:39 UTC (History)
10 users (show)

Fixed In Version: glusterfs-3.8.4-29
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1455049 (view as bug list)
Environment:
Last Closed: 2017-09-21 04:39:40 UTC
Embargoed:


Attachments (Terms of Use)
Simplefied automated test script (1.56 KB, text/plain)
2017-05-18 14:29 UTC, Niels de Vos
no flags Details
statedump of gluster/nfs that is waiting on calling dht_lk_cbk() for lock release (42.08 KB, text/plain)
2017-05-19 10:43 UTC, Niels de Vos
no flags Details
Statedumps of all the bricks (6) and the gluster/nfs server (11.05 KB, application/octet-stream)
2017-05-19 11:00 UTC, Niels de Vos
no flags Details
Statedumps of all the bricks (6) and the gluster/nfs server + nfs.log (130.18 KB, application/octet-stream)
2017-05-19 12:53 UTC, Niels de Vos
no flags Details
systemtap script for following the nfs+dht+disperse functions (932 bytes, text/plain)
2017-05-19 13:29 UTC, Niels de Vos
no flags Details
output of systemtap script when running the test against a one-brick volume (62.11 KB, text/plain)
2017-05-19 13:30 UTC, Niels de Vos
no flags Details
output of systemtap script when running the test against a disperse volume (71.60 KB, text/plain)
2017-05-19 13:31 UTC, Niels de Vos
no flags Details
Lock Script (1.59 KB, text/x-csrc)
2017-05-22 11:09 UTC, Manisha Saini
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:2774 0 normal SHIPPED_LIVE glusterfs bug fix and enhancement update 2017-09-21 08:16:29 UTC

Description Manisha Saini 2017-04-21 13:40:48 UTC
Description of problem:
When the lock is been taken from client on file say file1,So when the other client tries to take lock on the same file ,the lock will not be granted as the lock is been held by client 1.
So when trying to release the lock from client1,It unable to release the lock and gets hang

Version-Release number of selected component (if applicable):
glusterfs-fuse-3.8.4-23.el7rhgs.x86_64

How reproducible:
Consistently

Steps to Reproduce:
1.Create a 6 Node gluster
2.Create an EC volume 2 x (4 + 2).Enable GNFS on the volume
3.Mount the volume to 2 clients.
4.Create a file say file1 of 512 bytes from client 1
5.Now take the lock on the same file from client1
6.Try taking the lock on the same file from client2.(Lock will not be granted for client 2 because it is already held by client 1)
7.Now release the lock from client 1

Client 1:
-----
[root@dhcp37-192 home]# ./a.out /mnt/disperse/file1 
opening /mnt/disperse/file1
opened; hit Enter to lock... 
locking
locked; hit Enter to write... 
Write succeeeded 
locked; hit Enter to unlock... 
unlocking
-----

Client 2
-----
[root@dhcp37-142 home]# ./a.out /mnt/disperse1/file1 
opening /mnt/disperse1/file1
opened; hit Enter to lock... 
locking
-----

Actual results:
It unable to release the lock from file and gets hang

Expected results:
It should able to release the lock from client1

Additional info:

I was trying to clear need info of the bug -https://bugzilla.redhat.com/show_bug.cgi?id=1411338 (To test it with latest gluster build to check whether the issue still persist)
But as it got stuck in the 1st step itself ,I am unable to proceed.

This used to pass earlier in build glusterfs-3.8.4-10.el7rhgs.x86_64 .


Note:This issue is only observed with EC+GNFS

Comment 2 Niels de Vos 2017-05-15 10:22:18 UTC
This is reproducible for me too, with recent builds (where gluster/nfs does not segfault anymore).

Comment 5 Niels de Vos 2017-05-18 14:29:01 UTC
Created attachment 1280044 [details]
Simplefied automated test script

This script makes it reproducible on a single NFS-client. It really is only possible to reproduce when a disperse volume is used.

Comment 6 Niels de Vos 2017-05-18 16:42:54 UTC
The NLM/UNLOCK call never seems to get a reply, and Wireshark shows retransmissions of the NLM/UNLOCK call (retransmitted by the NFS-client). It is not clear to me yet where the callback/unwind gets stuck or dropped.

Comment 7 Niels de Vos 2017-05-19 10:43:06 UTC
Created attachment 1280370 [details]
statedump of gluster/nfs that is waiting on calling dht_lk_cbk() for lock release

Comment 8 Niels de Vos 2017-05-19 11:00:44 UTC
Created attachment 1280371 [details]
Statedumps of all the bricks (6) and the gluster/nfs server

Comment 9 Niels de Vos 2017-05-19 12:53:19 UTC
Created attachment 1280416 [details]
Statedumps of all the bricks (6) and the gluster/nfs server + nfs.log

Statedumps from all bricks and the gluster/nfs server, obtained when the test script was hanging on releasing the 1st lock.

Comment 10 Niels de Vos 2017-05-19 13:29:46 UTC
Created attachment 1280421 [details]
systemtap script for following the nfs+dht+disperse functions

Comment 11 Niels de Vos 2017-05-19 13:30:43 UTC
Created attachment 1280423 [details]
output of systemtap script when running the test against a one-brick volume

Comment 12 Niels de Vos 2017-05-19 13:31:27 UTC
Created attachment 1280426 [details]
output of systemtap script when running the test against a disperse volume

Comment 13 Niels de Vos 2017-05-19 13:37:01 UTC
Hi Pranith (continuation from our earlier IRC chat),

here are the statedumps of the bricks and gluster/nfs server (attachment 1280416 [details]). The statedump of gluster/nfs was taken once the test script was hung after trying to release the lock.

When checking with systemtap, I can see that in the one-brick case the dht_lk_cbk is called and that results in NLM sending a reply to the NFS-client (which continues obtaining the 2nd lock). The same systemtap script against a disperse volume does not have this dht_lk_cbk. I base my assumptions on this and the brick statedumps that the unlock reply is somewhere stuck in ec.

If you need more details for debugging or help in reproducing, let me know. Thanks for your assistance!

Comment 14 Manisha Saini 2017-05-22 11:09:10 UTC
Created attachment 1280993 [details]
Lock Script

Comment 15 Sunil Kumar Acharya 2017-05-23 09:58:07 UTC
I am able to recreate the issue on latest master.

Steps to recreate the issue:

1. Create an EC volume(2+1 configuration) and FUSE mount it.
2. Touch a file on the mount point.
3. From a terminal(term-1) aquire lock on file and write some data,
   don't unlock.

[root@server1 setup]# ./lock /LAB/fuse_mounts/mount/file
opening /LAB/fuse_mounts/mount/file
opened; hit Enter to lock... 
locking
locked; hit Enter to write... 
Write succeeeded 
locked; hit Enter to unlock...

4. From another terminal(term-2) try acquiring lock on the same region
of the file.

[root@server1 setup]# ./lock /LAB/fuse_mounts/mount/file
opening /LAB/fuse_mounts/mount/file
opened; hit Enter to lock... 
locking

5. Try to unlock the file from term-1(step 3).

Step-5 should go through successfully. But on problematic code base
it hangs.

Issue was introduced as part of below code change:

++++++++++++++++++
commit f2406fa6155267fa747d9342092ee7709a2531a9
Author: Pranith Kumar K <pkarampu>
Date:   Fri Jan 27 16:17:49 2017 +0530

    cluster/ec: Fix cthon failures observed with ec volumes
    
    Since EC already winds one write after other there is no need to align
    application fcntl locks with ec blocks. Also added this locking to be
    done as a transaction to prevent partial upgrade/downgrade of locks
    happening.
    
    BUG: 1410425
    Change-Id: I7ce8955c2174f62b11e5cb16140e30ff0f7c4c31
    Signed-off-by: Pranith Kumar K <pkarampu>
    Reviewed-on: https://review.gluster.org/16445
    Smoke: Gluster Build System <jenkins.org>
    Reviewed-by: Xavier Hernandez <xhernandez>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>
++++++++++++++++++

Note: Use attachment "Lock Script" to generate the binary "lock"

Comment 19 Manisha Saini 2017-07-19 07:04:27 UTC
Verified this bug on 

#glusterfs-3.8.4-33.el7rhgs.x86_64

Steps:
1.Mount the volume to 2 different clients say client1 and client2 via GNFS
2.Create 1G of file on client 1
3.Take lock on that file from client 1 -> Lock is granted

Client 1
# ./a.out /mnt/GNFS_mani/File1 
opening /mnt/GNFS_mani/File1
opened; hit Enter to lock... 
locking
locked; hit Enter to write... 
Write succeeeded 
locked; hit Enter to unlock... 

4.Try Taking lock on same file from client 2 ->Lock is not granted

Client 2
# ./a.out /mnt/GNFS_mani/File1 
opening /mnt/GNFS_mani/File1
opened; hit Enter to lock... 
locking

5.Release the Lock from client 1 ->Lock is granted to client 2

Client 1:
locked; hit Enter to unlock... 
unlocking

Client 2:

Write succeeeded 
locked; hit Enter to unlock... 
unlocking


Moving this bug to verified state

Comment 21 errata-xmlrpc 2017-09-21 04:39:40 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2774


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