We have discovered a Confluence space that accidentally had the EDITSPACE permission allowed for anonymous users. Doh.
Spammers found this and added >2000 pages. This isn't so bad.
However, web crawlers did web crawler things, and hit the Create Page button approximately 750k times, mostly with URLs like this:
https://confluence.example.com:443/pages/createpage.action?fromPageId=240222349&spaceKey=EXT
We can see some of these pages, by using the ID in the URL, and they show with title $helper.page.title.
The overall size of our database (AWS RDS Aurora PostgreSQL) went from ~20 GB to ~110 GB due to this.
In particular, the confancestors table was previously around 87 MB and is now 84 GB (1000x times increase). That table now has 777 million rows (was about 700k rows).
The space only had a few pages before this started, so I am happy to move those, and then blow away the space entirely. However, on a test clone of our production system, I have initiated an entire space removal, which gets stuck at 2% with an ever-increasing 'Time Remaining'. While this runs, the size of the confancestors table again grows rapidly (added another 30 GB when left running for 1 day), although the row count does not change.
Any advice on a better recovery / removal strategy ?