How to solve many orphan relation

For feature requests, please see: http://www.mattermost.org/feature-requests/.

For troubleshooting questions, please post in the following format:

Summary

Many orphan relation

Steps to reproduce

bin/mattermost integrity --confirm --verbose
Mattermost Version 5.21

Expected behavior

No orphan relation

Observed behavior

Found 5 records in relation FileInfo orphans of relation Posts
Child 1ohr7tg1gbfddbbqm7tskhicno (FileInfo.Id) has empty ParentIdAttr (FileInfo.PostId)
Child 895j9xdsxbn73ycmn8w3difjbh (FileInfo.Id) has empty ParentIdAttr (FileInfo.PostId)
Child dhqdotqohjyi9b51addfc9p5ar (FileInfo.Id) has empty ParentIdAttr (FileInfo.PostId)
Child eukmn7urjjngiyws9i5x4ribjr (FileInfo.Id) has empty ParentIdAttr (FileInfo.PostId)
Child ixmc6f8hw7r3tpctneqx8xjpay (FileInfo.Id) has empty ParentIdAttr (FileInfo.PostId)
Found 0 records in relation Posts orphans of relation Posts
Found 0 records in relation Posts orphans of relation Posts
Found 0 records in relation Reactions orphans of relation Posts
Found 0 records in relation Channels orphans of relation Schemes
Found 0 records in relation Teams orphans of relation Schemes
Found 488 records in relation Audits orphans of relation Sessions
Child 3euyab8x1jybdehjq894dm7mkh (Audits.Id) is missing Parent 717hwhyah7b47yqm4et1j96h4h (Audits.SessionId)
Child 6paqk79ym7y58ya5ymupgr8nqy (Audits.Id) is missing Parent 717hwhyah7b47yqm4et1j96h4h (Audits.SessionId)
Child 95y4izbz338gpncsfxw11frgth (Audits.Id) is missing Parent 717hwhyah7b47yqm4et1j96h4h (Audits.SessionId)
Child 9wa8qch1xpgdbd68qz5hbq597r (Audits.Id) is missing Parent 717hwhyah7b47yqm4et1j96h4h (Audits.SessionId)
Child az5qc9u88br39pr36fa4u5hozw (Audits.Id) is missing Parent 717hwhyah7b47yqm4et1j96h4h (Audits.SessionId)
Child d6xw6xz5yfg1upaepxg4fep1sw (Audits.Id) is missing Parent 717hwhyah7b47yqm4et1j96h4h (Audits.SessionId)
Child egnq3jqwcidetm5pewwphunj8c (Audits.Id) is missing Parent 717hwhyah7b47yqm4et1j96h4h (Audits.SessionId)
Child f8rah4d6cbngfnzkho4xybt9dy (Audits.Id) is missing Parent 717hwhyah7b47yqm4et1j96h4h (Audits.SessionId)
Child h5u6mawx3bfo8enx4i6nqkaspr (Audits.Id) is missing Parent 717hwhyah7b47yqm4et1j96h4h (Audits.SessionId)
Child hrrbcwkotfnm7kd6i9r4ydeith (Audits.Id) is missing Parent 717hwhyah7b47yqm4et1j96h4h (Audits.SessionId)
Child ig4sgecot3bxp8tx7am6tkx4pa (Audits.Id) is missing Parent 717hwhyah7b47yqm4et1j96h4h (Audits.SessionId)
Child nwd38e1witnbddafadtm1ucxea (Audits.Id) is missing Parent 717hwhyah7b47yqm4et1j96h4h (Audits.SessionId)
Child sm6hb85pwid57qm4dzo4c54p5h (Audits.Id) is missing Parent 717hwhyah7b47yqm4et1j96h4h (Audits.SessionId)
Child tj5gtqdwhbr6jfdyapsepfeayy (Audits.Id) is missing Parent 717hwhyah7b47yqm4et1j96h4h (Audits.SessionId)
Child uwk3rtzx93gdtfwzqp8wmypday (Audits.Id) is missing Parent 717hwhyah7b47yqm4et1j96h4h (Audits.SessionId)
Child uzqacnrdr7nxjem5ewc3i3au4w (Audits.Id) is missing Parent 717hwhyah7b47yqm4et1j96h4h (Audits.SessionId)
Child wj4s93ytxif35bfer8bicwiete (Audits.Id) is missing Parent 717hwhyah7b47yqm4et1j96h4h (Audits.SessionId)
Child 1au79fr6bff4mb9d91tgcakkoy (Audits.Id) is missing Parent 98apw964jbbhdmmwppitee6ydc (Audits.SessionId)
Child 3y7uxwo4ojbobjbex8cginhzay (Audits.Id) is missing Parent 98apw964jbbhdmmwppitee6ydc (Audits.SessionId)
Child 45hhogzexbrijem3gra5jyy1za (Audits.Id) is missing Parent 98apw964jbbhdmmwppitee6ydc (Audits.SessionId)
Child 4kkcjdwbfjb87efrscseqm14gy (Audits.Id) is missing Parent 98apw964jbbhdmmwppitee6ydc (Audits.SessionId)
Child 571rigfsqidpdj1u96mjnk96dy (Audits.Id) is missing Parent 98apw964jbbhdmmwppitee6ydc (Audits.SessionId)
Child 5p7tj97o47dt78ux5sqm1w34ya (Audits.Id) is missing Parent 98apw964jbbhdmmwppitee6ydc (Audits.SessionId)
Child 6fu5ubwu73bh3b9mks86mta9br (Audits.Id) is missing Parent 98apw964jbbhdmmwppitee6ydc (Audits.SessionId)
Child 77gg3os1pbfo38fkuxu4jsdkoy (Audits.Id) is missing Parent 98apw964jbbhdmmwppitee6ydc (Audits.SessionId)
Child 7pch8o447jyd9cp3d46b53r7ga (Audits.Id) is missing Parent 98apw964jbbhdmmwppitee6ydc (Audits.SessionId)
Child 8bwgdoccntfpfjm5fhribkpeay (Audits.Id) is missing Parent 98apw964jbbhdmmwppitee6ydc (Audits.SessionId)
Child 951pujsbbiyx8d3uupu399uhua (Audits.Id) is missing Parent 98apw964jbbhdmmwppitee6ydc (Audits.SessionId)
Child 9ox5d3jyy3nwbcqwj8zmcnouoa (Audits.Id) is missing Parent 98apw964jbbhdmmwppitee6ydc (Audits.SessionId)
Child aa4rkaqbhbf1tyapd5t1r3449e (Audits.Id) is missing Parent 98apw964jbbhdmmwppitee6ydc (Audits.SessionId)
Child aojfubxegirpujn5xz3x396hqw (Audits.Id) is missing Parent 98apw964jbbhdmmwppitee6ydc (Audits.SessionId)
Found 21 records in relation Channels orphans of relation Teams
Child 33tzxu4awpyimko1unyoqg787a (Channels.Id) has empty ParentIdAttr (Channels.TeamId)
Child 3tmc4guoaib8inm1wtzc9b9xmy (Channels.Id) has empty ParentIdAttr (Channels.TeamId)
Child 8oafjjfzrfdfi8sx7ahejdbmcc (Channels.Id) has empty ParentIdAttr (Channels.TeamId)
Child 8qtbjpeu3pyajphuwuwymcgxch (Channels.Id) has empty ParentIdAttr (Channels.TeamId)
Child 9isnrqbuh7rtf8u9m4kfqw7cwh (Channels.Id) has empty ParentIdAttr (Channels.TeamId)
Child 9m88b75jiidmxm5fcocfqy791a (Channels.Id) has empty ParentIdAttr (Channels.TeamId)
Child 9r6ttietctnbzmed8r1m8jgonh (Channels.Id) has empty ParentIdAttr (Channels.TeamId)
Child ajda3o7f8ff1xr6d63e5iqcito (Channels.Id) has empty ParentIdAttr (Channels.TeamId)
Child bi4ck885gt8yzfgj4jhg6inuzy (Channels.Id) has empty ParentIdAttr (Channels.TeamId)
Child cn38kne3ab8i7fz4f91aa59i1a (Channels.Id) has empty ParentIdAttr (Channels.TeamId)
Child fym7yo5cxig6xyged6uaeycwir (Channels.Id) has empty ParentIdAttr (Channels.TeamId)

Hello, @oki

I asked this question in the Ask R&D channel if you would like to join the conversation. I just want to understand what it means, why we are seeing it, and how to fix it.