Existing home folders matching appX name are not used. Then the internal redis counter is incremented by one.
If it a finds a /home/app1 folder, it fails and increments the internal redis counter to +1 (equals 2). The next add module attempt will use /home/app2.
Numbering is always incrementing. It does not reuse gaps.
Do not recall if add-module command allows you to specify a custom app number. EDIT: it doesn’t
Not sure. Either odoo was installed at some point or app installation failed or was canceled, incrementing internal redis app index.
Is it possible to change the redis app index? don’t know but maybe (with redis-cli).