在清理空间和重新填充空间之间陷入循环

Yet, things went wrong because I did exactly that:

So I guess this was a situation where a database upgrade was required.

Bur how do I know whether a database upgrade is required?