Bug 1332237 - SAMBA : New file created in windows mount is not listed in share for quite a while even after multiple refresh on the share
Summary: SAMBA : New file created in windows mount is not listed in share for quite a...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat Storage
Component: samba
Version: rhgs-3.1
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: RHGS 3.1.3
Assignee: Raghavendra Talur
QA Contact: Vivek Das
URL:
Whiteboard:
Depends On:
Blocks: 1311817
TreeView+ depends on / blocked
 
Reported: 2016-05-02 15:14 UTC by Vivek Das
Modified: 2018-05-21 21:53 UTC (History)
9 users (show)

Fixed In Version: samba-4.4.3-6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-06-23 05:36:58 UTC
Embargoed:


Attachments (Terms of Use)
packet capture (5.82 KB, application/octet-stream)
2016-05-30 14:33 UTC, Raghavendra Talur
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1245 0 normal SHIPPED_LIVE gluster-smb bug fix and enhancement update 2016-06-23 09:13:06 UTC

Description Vivek Das 2016-05-02 15:14:48 UTC
Description of problem:

When we try to create a new microsoft word file over a mounted tier volume in windows client the file does get created but it is not getting listed on the share, even after repeated refresh action over the share the new file created is not listed.
Then when we try to create another new microsoft word file it gets renamed and created and only after that when we refresh the first file is listed.

In an another instance when we create a microsoft word file in windows client-1 it gets created but the same file is not listed in same volume share from another windows client-2 even after continuous refresh of the share. (around a 6minutes) and then again when we try to create another new microsoft word file it gets renamed and created and only after that when we refresh the first file is listed in windows client-2

Version-Release number of selected component (if applicable):
glusterfs-3.7.9-3.el7rhgs.x86_64
samba-client-libs-4.4.2-1.el7rhgs.x86_64
Windows Client 8.1

How reproducible:
6/10 times

Steps to Reproduce:
1.Tier volume mount in windows client1 & windows client2
2.Create a new microsoft word file by right click in the share
3.Refresh from both the windows client

Actual results:
File is not getting listed

Expected results:
File should get listed immediately

Additional info:

Comment 4 Vivek Das 2016-05-06 13:51:24 UTC
Update :
---------

The issue is not always hit on the fresh / first attempt. But gradually when we work on the share intensely like running multiple IOs and keeping the share busy we get the above issue.

When testing with tiered volume this issue was seen and hence reported.
Now when i am trying with other volumes, i am able to reproduce the same.

Few information below:
------------------------
1.The issue is also observed in Distribute & Disp-Rep volume.
2.The issue exists not only with Microsoft Windows files but also text files.
3.Whether files and directories are created or deleted it is not getting reflected in the share mount even after a gap of 15-20minutes.

Comment 9 Michael Adam 2016-05-25 12:21:28 UTC
The notify sub-system has changed in Samba 4.3.
The notify watch into the file system can be provided by different callbacks depending on the configuration and capabilities of the (build)system.

The default is inotify. But in our case of the glusterfs vfs module,
this can obviously not work since our paths are not paths in a posix file system that inotify can work with.

Hence we need to disable inotify by setting "notify:inotify = no" in smb.conf (global section) (on all nodes).

==> Please test this next.

If proper functionality is confirmed, we should probably make sure by a code change in the glustefs vfs module, that this is enforced.

Ultimately, we might extend Samba to have notify-watch as a VFS operation that can then be provided by the glusterfs vfs module...

Comment 10 Michael Adam 2016-05-25 13:09:48 UTC
Update:

Instead of doing notify:inotify = no, the documented setting
'kernel change notify = no' should achieve exactly the same thing.

Cheers - Michael

Comment 11 Raghavendra Talur 2016-05-25 14:13:56 UTC
I tested with the change suggested.
i.e with kernel change notify = no and verified that it works exactly as expected.

I will remove the needinfo on vdas and would suggest that we make a build with the patch as provided by Michael in the mail thread. Also, changing the bug to post state to indicate that we have a patch ready.

Would request that we get the build as soon as possible.

Comment 15 Raghavendra Talur 2016-05-30 14:32:48 UTC
My observation with new build:

1. If both the windows clients have the same dir open then a new file create/delete etc is reflected immedietely in the other windows client. (note that this is happening only after we brought the "Kernel change notify = no" option, earlier this wasn't working either).

2. Navigate to a dir in windows client1 say /a/b/c. Navigate to the same dir in windows client2. Now, create a file file.txt in client1, you should be able to see it in client2 immediately. Now, in client2, move back to / dir of the share. On client1, create another file say file2.txt. If you navigate to /a/b/c in client2 now, you won't find file2.txt. This does not change even after multiple refreshes are performed on the GUI. Performing a DIR in powershell at the same location does not show new file too. This is the bug.


Few more subtle points
a. If /a/b/c was never accessed in client2 and it was now accessed for the first time then all files are seen. So it has to do something with notification.
b. The same test as mentioned above in 2. was performed on a xfs share with no gluster involved and the same bug was observed.


I am attaching a packet capture showing packets on client2 when a refresh was performed but no new packets were seen.

Comment 16 Raghavendra Talur 2016-05-30 14:33:30 UTC
Created attachment 1162820 [details]
packet capture

Comment 17 Michael Adam 2016-05-30 16:11:00 UTC
(In reply to Raghavendra Talur from comment #15)
> My observation with new build:
> 
> 1. If both the windows clients have the same dir open then a new file
> create/delete etc is reflected immedietely in the other windows client.
> (note that this is happening only after we brought the "Kernel change notify
> = no" option, earlier this wasn't working either).
> 
> 2. Navigate to a dir in windows client1 say /a/b/c. Navigate to the same dir
> in windows client2. Now, create a file file.txt in client1, you should be
> able to see it in client2 immediately. Now, in client2, move back to / dir
> of the share. On client1, create another file say file2.txt. If you navigate
> to /a/b/c in client2 now, you won't find file2.txt. This does not change
> even after multiple refreshes are performed on the GUI. Performing a DIR in
> powershell at the same location does not show new file too. This is the bug.
> 
> 
> Few more subtle points
> a. If /a/b/c was never accessed in client2 and it was now accessed for the
> first time then all files are seen. So it has to do something with
> notification.
> b. The same test as mentioned above in 2. was performed on a xfs share with
> no gluster involved and the same bug was observed.
> 
> 
> I am attaching a packet capture showing packets on client2 when a refresh
> was performed but no new packets were seen.

Thanks for the updates.
I will look into this more deeply.


But we need to very specific, in a cluster, where who connects, since
it may make a difference. We have at least three scenarios, assuming
two different clients connecting:


case1: client1 connects to IP1,
       client2 connects to IP2, which is on the same node as IP1

case2: client1 connects to IP1,
       client2 connects to IP2, which is on a different node than IP1

case3: client1 connects to IP1
       client2 connects to IP1 (the *same* IP)

Comment 18 Michael Adam 2016-05-30 17:31:49 UTC
(In reply to Raghavendra Talur from comment #15)
> My observation with new build:

Comments on these observations since I only commented on the scenarios
in my last comment:

> 1. If both the windows clients have the same dir open then a new file
> create/delete etc is reflected immedietely in the other windows client.
> (note that this is happening only after we brought the "Kernel change notify
> = no" option, earlier this wasn't working either).

Good! So at least this hase changed (improved) something.

> 2. Navigate to a dir in windows client1 say /a/b/c. Navigate to the same dir
> in windows client2. Now, create a file file.txt in client1, you should be
> able to see it in client2 immediately. Now, in client2, move back to / dir
> of the share. On client1, create another file say file2.txt. If you navigate
> to /a/b/c in client2 now, you won't find file2.txt. This does not change
> even after multiple refreshes are performed on the GUI. Performing a DIR in
> powershell at the same location does not show new file too. This is the bug.


Very interesting, indeed. I'll dig deeper here...


> Few more subtle points
> a. If /a/b/c was never accessed in client2 and it was now accessed for the
> first time then all files are seen. So it has to do something with
> notification.

Right.

> b. The same test as mentioned above in 2. was performed on a xfs share with
> no gluster involved and the same bug was observed.

Good point. It is always good to have as minimal a reproducer as possible.
Will try to put this into a samba selftest.

> I am attaching a packet capture showing packets on client2 when a refresh
> was performed but no new packets were seen.

Comment 19 Michael Adam 2016-06-06 10:29:26 UTC
Summary of the findings so far:

The remaining issue seems to be a client issue:
Specific versions of windows 7 and windows 8 seem to be affected under certain configuration scenarios. And it does not seem to be a blocker.

Windows 7 (not fully patched) test result:
- with SMB1: no problem
- with SMB2 and oplocks disabled: no problem
- with SMB2 and smb2 leases enabled: no problem
- only with SMB2 and oplocks but not leases: problem
- this problem also exists with Samba 4.2
  ==> not a regression.

Windows 8:
- with this machine the issue was first discovered
- still re-testing the full matrix with that one

Windows 8.1:
- no issue seen with any config / version.

Based on this, the change of 'kernel change notify = no' seems to have
fixed the original issue, and the remaining issues seem to be client-bugs
in specific Windows-versions regarding notify in combination with oplocks.
 
Moving back to ON_QA for verification.

Comment 20 Michael Adam 2016-06-06 22:09:09 UTC
I confirmed that the bug happens with windows 8 against samba 4.2 (and 4.3) as well. So no regression for Windows 8, either.

Comment 21 Vivek Das 2016-06-07 05:57:39 UTC
According to the original bug posted (refer comment #4) this bug is not reproducible with the fix provided. So marking this as Verified. 

Howerever a new bug will be opened for the bug mentioned in comment #12.

Comment 23 errata-xmlrpc 2016-06-23 05:36:58 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-2016:1245


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