Backport #30511 by @yp05327 Fix #30508 ps: if `sourceID` is not set, `LoginName` will be ignored Co-authored-by: yp05327 <576951401@qq.com> (cherry picked from commit f9a025f6a358aa6e34408743a59f5081f397d47c)