HA history database corrupt at 4:11am once again

I’m getting really tired of this happening. My HA was misbehaving on thursday night, and I had to restore it from backup. On saturday morning at 4:11am, the 1GB history database was reset to empty.
I’m trying to restore another (earlier) nightly backup. But this history issue is very problematic.

My questions are :

  1. After I restore the backup, is there a way to manually force HA to purge the DB, without having to wait until 4:11am ? This is to check if the DB is in a healthy state.
  2. Is there a reliable way to fix the database state once HA considers it corrupt ?
    I have tried various methods before, but none worked. My last full database loss was in June. Backup size was in the 1GB range too. I am wondering if there is a hard size limit in effect.

Oddly I’m looking at a problem with my HA install and I think a corrupt database (mariadb) and the last updates on some entities appears to be just before 04:11 this morning.

Is there something that happens around this time or is this a massive co-incidence?

Not a coincidence. Recorder.purge happens at 4:11am each night.

Thanks - that gives me a little more to go on.