[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: |
|
||||||||||||||||||||||||
| 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 " 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 |
| Comment by Gerrit Updater [ 10/Oct/22 ] |
|
"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/48430/ |
| 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 |
| 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 |