[LU-15646] fix DOSTID printing of llog_id FIDs Created: 13/Mar/22  Updated: 26/Sep/23  Resolved: 10/Oct/22

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.16.0

Type: Bug Priority: Minor
Reporter: Andreas Dilger Assignee: Mikhail Pershin
Resolution: Fixed Votes: 0
Labels: easy

Issue Links:
Duplicate
is duplicated by LU-15936 DOSTID macro is not printing llog IDs... Resolved
Gantt End to Start
Related
is related to LU-15644 failed llog cancel should not generat... Open
is related to LU-15645 gap in recovery llog should not be a ... Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

It looks like lgl_oi.oi_fid is used in quite a number of places, but any use of lgl_oi.oi_fid looks to be incorrect (f_seq and oi_seq are in opposite order in struct ost_objid). This was broken by patch https://review.whamcloud.com/25640 "LU-9153 llog: update llog print format to use FIDs". It is only using oi_fid like PFID(&...lgl_oi.oi_fid), so this is only affecting error messages and not any functionality.

log_process_thread()) lfs02-MDT001e-osp-MDT0000: [0x3:0x1b70:0x4] Invalid record: index 16123 but expected 16122

The output "[0x3:0x1b70:0x4]" should be interpreted as FID [0x400001b70:0x3:0x0] (swap last and first components of the field, add intervening "0000" and add ":0x0" at the end) in the update_log_dir/ directory.

To print these FIDs correctly, there is a logid_to_fid() helper with the DOSTID macro, and it would make sense to have it also return the same pointer as the passed-in fid argument, so that it can be passed directly to PFID() in the error message, like:

        struct lu_fid tmp_fid;

        CERROR("%s: "DFID" Invalid record: index %u but expected %u\n",
               loghandle2name(loghandle),
               PFID(logid_to_fid(&loghandle->lgh_id, &tmp_fid)),          
               rec->lrh_index, index);

Alternately, it would be more efficient to add a new PLOGID() macro that is returning oi_seq, oi_id, 0, directly, and avoid the need for tmp_fid entirely.



 Comments   
Comment by Andreas Dilger [ 14/Jun/22 ]

Also, llog_reader is not printing the FIDs/pathnames correctly for the catalogs under update_log_dir:

# ls
total 292
36 [0x200000400:0x1:0x0]   0 [0x200000401:0x3:0x0]  36 [0x200000403:0x1:0x0]
36 [0x200000400:0x2:0x0]  36 [0x200000402:0x1:0x0]  36 [0x200000403:0x2:0x0]
36 [0x200000401:0x1:0x0]  36 [0x200000402:0x2:0x0]   0 [0x200000403:0x3:0x0]
40 [0x200000401:0x2:0x0]   0 [0x200000402:0x3:0x0]
[root@centos7 update_log_dir]# llog_reader '[0x200000402:0x1:0x0]'
rec #1 type=1064553b len=64 offset 32768
rec #2 type=1064553b len=64 offset 32832
Header size : 32768      llh_size : 64
Time : Sun Jun 12 22:29:38 2022
Number of records: 2    cat_idx: 0      last_idx: 2
Target uuid : 
-----------------------
#01 (064)id=[0x2:0x402:0x2]:0 path=O/8589935618/d2/2
#02 (064)id=[0x3:0x402:0x2]:0 path=O/8589935618/d3/3

The FIDs should be [0x200000402:0x2:0x0] and [0x200000402:0x3:0x0], and the pathnames are meaningless - they should be under update_log_dir for the DNE recovery logs.

Comment by Mikhail Pershin [ 14/Sep/22 ]

"Mikhail Pershin <mpershin@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/48430
Subject: LU-15646 llog: correct llog FID and path output
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 42517821d219a299a428902abd34501dd95891db

Comment by Gerrit Updater [ 10/Oct/22 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/48430/
Subject: LU-15646 llog: correct llog FID and path output
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: e28f3ee185b2ef7bad8046f46444772fac214a40

Comment by Peter Jones [ 10/Oct/22 ]

Landed for 2.16

Comment by Gerrit Updater [ 17/Oct/22 ]

"Jian Yu <yujian@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/48901
Subject: LU-15646 llog: correct llog FID and path output
Project: fs/lustre-release
Branch: b2_15
Current Patch Set: 1
Commit: 7fec2d29a8ccb5e80ded409de2be3d85c53d40c3

Comment by Gerrit Updater [ 21/Dec/22 ]

"Etienne AUJAMES <eaujames@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/49472
Subject: LU-15646 llog: correct llog FID and path output
Project: fs/lustre-release
Branch: b2_12
Current Patch Set: 1
Commit: 7176bc9204c134731d96f5151c3709aaec8a4f9e

Generated at Sat Feb 10 03:20:07 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.