Aiven-Open / myhoard

MySQL Backup and Point-in-time Recovery service
Apache License 2.0
93 stars 20 forks source link

Trying to restore to master #194

Open CodeBleu opened 1 week ago

CodeBleu commented 1 week ago

Is it possible to restore a backup back to the main node? I've tried to use the API to restore, but it wouldn't work. I manually edited the myhoard_controller_state.json file in the state directory to change from active to idle and then run a curl command to do a restore.

I get a "phase": "failed", after it copies all the prefetch files in my /var/lib/mysql dir.

last log entry is: Nov 14 15:17:05 jwh-srlinux-lab bash[1687267]: 2024-11-14 15:17:05,611 BinlogDownloader INFO 'default/2024-11-14T03:00:00.647931+00:00Z_01ac71e7-46ed-43f5-8b33-e7f93f58f0ee/binlogs/0/131_1' successfully saved as '/var/lib/mysql/relay.000221.prefetch' in 0.04 seconds status is

curl -s -XGET -H "Content-Type: application/json" http://localhost:16001/status | jq
{ 
"mode": "restore"
}

curl -s XGET -H "Content-Type: application/json" http://localhost:16001/status/restore | jq

{
  "basebackup_compressed_bytes_download": 0,
  "basebackup_compressed_bytes_total": 1644805,
  "binlogs_being_restored": 0,
  "binlogs_pending": 221,
  "binlogs_restored": 0,
  "phase": "failed"
}

@packi I see you're active right now. Just wondering if you could help me figure this out? I'm new to this myhoard, but would really like to figure out how to get it to work.