i'm sorry but you were clearly attacked because of some bug.
I read from
another topic that you are using 2.3a, and that explains all.
Sadly, in the world of server software you cannot stay behind updates and be exposed on the internet. You could only if you stayed in a closed and safe environment, or you make a detailed research and find that no update you are missing contains critical fixes.