[LU-2298] Changelog does not register file modifications Created: 07/Nov/12 Updated: 18/Jul/17 Resolved: 18/Jul/17 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.1.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Diego Moreno (Inactive) | Assignee: | Niu Yawei (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Severity: | 3 |
| Rank (Obsolete): | 5491 |
| Description |
|
The problem comes when some tools try to detect changes in files thanks to the changelog functionality. The changelog is regularly read (every second) from a registered client (actually the only one registered) and then the records are acknowledged so they can be deleted in the changelog. At the same time, on another Lustre client we run the next process every second on a file:
We would expect to see MTIME or OPEN or CREATE in the changelog but we don't see anything. The only way to see an MTIME event is to specify a SETATTR operation which provokes the modification on the MDT. Another example of this pattern can be seen with the differences between cat and touch commands. If we run "cat whatever >> my_lustre_file", the MDT will never see the modification. If we run "touch my_lustre_file", then we'll see an MTIME event as touch command will specifically do SETATTR. It is normal not to see any modification while the write is being done on the OSTs but my question is: shouldn't MDT see the modification once the file is closed? Because if applications must do a SETATTR then I'm not sure that changelog can be used to detect any kind of event. Description of the reproducer:
[root@hsm6 ~]# cat /proc/fs/lustre/mdd/hsmfs-MDT0000/changelog_users [root@hsm6 ~]# cat /proc/fs/lustre/mdd/hsmfs-MDT0000/changelog_mask
>>>lfs changelog hsmfs-MDT0000 >>>lfs changelog_clear hsmfs-MDT0000 cl1 29723 >>>lfs changelog hsmfs-MDT0000 And the changelog will always remain in the last entry until the client acknowledges an entry (having then another MARK event). |
| Comments |
| Comment by Peter Jones [ 08/Nov/12 ] |
|
Niu Could you please look into this one? Thanks Peter |
| Comment by Niu Yawei (Inactive) [ 08/Nov/12 ] |
Without SOM (size on MDS), the MTIME is stored on OSTs, and MDT will not see the modification on file close neither (we only update ATIME on flie close). So, with current design, I think it's not a good idea to detect file data changes by changelog. |
| Comment by jacques-charles lafoucriere [ 09/Nov/12 ] |
|
| Comment by Thomas LEIBOVICI - CEA (Inactive) [ 22/Nov/12 ] |
|
Looking at the changelog code, I suspect a matter in the changelog mechanism Thomas |
| Comment by Niu Yawei (Inactive) [ 29/Nov/12 ] |
Probably.
I'm not sure, probably the tool can check the file itself according the open/close record in changelog? |
| Comment by Diego Moreno (Inactive) [ 05/Dec/12 ] |
|
Niu,
|
| Comment by Niu Yawei (Inactive) [ 05/Dec/12 ] |
|
Hi, Diego
As far as I know, OSTs don't send the TIME to MDT, and there isn't any changelogs on OSTs. When client writing to OST, only the objects on OST is written, no MDT involved.
Ah, you are right, CL_CLOSE (close event) isn't recorded in 2.1. I'm not sure if it's worth improving the changelog to make it achieve your requirement, since I beleive that could have been resolved in HSM project. How about detecting the file changes in user level (for lustre 2.1)? for example, scanning the file changes by a background daemon? |
| Comment by Vitaly Fertman [ 21/Mar/13 ] |
|
CLOSE event could be optionally logged since lustre 2.2, landed as |
| Comment by Nathan Rutman [ 25/Mar/13 ] |
|
mdt_mfd_close seems to filter out mtime updates from the close for SOM. |
| Comment by Nathan Rutman [ 25/Mar/13 ] |
|
Thomas, what does Robinhood do to detect mtime updates? |
| Comment by Nathan Rutman [ 25/Mar/13 ] |
|
Note |
| Comment by Thomas LEIBOVICI - CEA (Inactive) [ 26/Mar/13 ] |
|
Since this LU was opened, robinhood now relies on both MTIME and CLOSE events to detect file modifications (Lustre 2.2+ and robinhood 2.4.1). |
| Comment by Vitaly Fertman [ 26/Mar/13 ] |
|
Nathan Rutman added a comment - 25/Mar/13 8:07 PM wrong, SOM is not related here, it did not change the original logic. this filtering existed since the beginning. |
| Comment by Vitaly Fertman [ 26/Mar/13 ] |
|
Nathan Rutman added a comment - 25/Mar/13 8:56 PM afaics, it is still in place, otherwise sanity test 160 would not work. |
| Comment by Nathan Rutman [ 28/Mar/13 ] |
|
From Thomas: I made a few tests on Lustre 2.1 and Lustre 2.4 (master) and I get the same behavior: echo 1 > /mnt/lustre/dir/test 55585 01CREAT 07:58:30.990467019 2013.03.27 0x0 t=[0x200000400:0x73a6:0x0] p=[0x200000400:0x73a5:0x0] test echo 1 > /mnt/lustre/dir/test 55586 17MTIME 07:58:36.765666783 2013.03.27 0x6 t=[0x200000400:0x73a6:0x0] echo 1 >> /mnt/lustre/dir/test <nothing> dd if=/dev/urandom of=/mnt/lustre/dir/test bs=1k count=50000 55587 17MTIME 07:58:49.788543052 2013.03.27 0x6 t=[0x200000400:0x73a6:0x0] dd if=/dev/urandom of=/mnt/lustre/dir/test bs=1k count=50000 conv=notrunc <nothing> |
| Comment by Thomas LEIBOVICI - CEA (Inactive) [ 04/Apr/13 ] |
|
Notice: we get CL_CLOSE for the "nothing" cases in Lustre 2.2 and later. The issue of Diego (also reported by James Silva, LLNL) is the robinhood DB do not reflect the actual file sizes |
| Comment by Diego Moreno (Inactive) [ 04/Apr/13 ] |
|
I do agree with Thomas that managing CLOSE events should be enough for Robinhood. Concerning the MTIME event, I think it's hard for users or applications reading changelog to rely on this event because, as Nathan already commented, you cannot see MTIME in case of append to an existing file. |
| Comment by Cory Spitz [ 05/Jun/13 ] |
|
It seems that TRUNC events are not raised at all. Should there be a separate ticket created for that? |
| Comment by James A Simmons [ 24/Feb/16 ] |
|
Is this still true? |
| Comment by Niu Yawei (Inactive) [ 18/Jul/17 ] |
|
CLOSE event has been logged since 2.2, it can satisfy customer's requirement. Close this old 2.1 issue. |