Stuck in a loop of freeing up space and filling it up again when rebuilding

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?