[LU-16555] print more YAML compatible special chars for jobid Created: 15/Feb/23  Updated: 10/Mar/23  Resolved: 08/Mar/23

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

Type: Improvement Priority: Minor
Reporter: Feng Lei Assignee: Feng Lei
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
is related to LU-11407 Improve stats data Resolved
Rank (Obsolete): 9223372036854775807

 Description   

print more YAML compatible special chars for jobid. They are:

':', '/'.



 Comments   
Comment by Gerrit Updater [ 15/Feb/23 ]

"Feng Lei <flei@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/49998
Subject: LU-16555 obdclass: print more special chars for jobid
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 6117dedfc8823d7b0de0f5912cda18ea16b0d6a7

Comment by Gerrit Updater [ 23/Feb/23 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/49998/
Subject: LU-16555 obdclass: print more special chars for jobid
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 12604ac4deb242877bac5f12f517c2a5c0c2c72f

Comment by Peter Jones [ 23/Feb/23 ]

Landed for 2.16

Comment by Andreas Dilger [ 27/Feb/23 ]

I just saw a system with JobIDs that look like "0:0:" or "12345:23456:", which is apparently "%u:%g:%j", where "%j" is unset on login nodes. This is causing YAML parsing by collecd to fail in the case where ":" is at the end of the JobID string. Pasting these job_stats into http://yaml-online-parser.appspot.com/ confirms that quoting the "0:0:" string fixes the parsing error.

Comment by Feng Lei [ 28/Feb/23 ]

So we need 3 types of chars:

  1. common chars (alnum +".@-_:/"), which can be printed literally
  2. other chars which should be escaped
  3. chars which indicate jobid should be quoted, which is actually chars of 2 + ':'

Make sense?

Comment by Andreas Dilger [ 28/Feb/23 ]

Yes, if ":" is at the end then the JobID needs to be quoted or there is a YAML parsing error. When I reviewed the original 49998 patch I thought this couldn't happen easily, but with the empty "jobid_var" variable and a ":" separator this is easy to hit (or even if users just add a ":" at the end of jobid_name for whatever reason).

Comment by Gerrit Updater [ 28/Feb/23 ]

"Feng Lei <flei@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/50150
Subject: LU-16555 obdclass: quote jobid with ':' char
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 27729ac227266699730b5c39dfdad4c5533f88a5

Comment by Gerrit Updater [ 08/Mar/23 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/50150/
Subject: LU-16555 obdclass: quote jobid with ':' char
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: a99eb0210a5741138981e999082c695aef0dffff

Comment by Peter Jones [ 08/Mar/23 ]

Landed for 2.16

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