-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(storage): implement backup and restore #16504
Conversation
a55f0aa
to
38629d9
Compare
@tmgordeeva this is weird. Restore to existing directory works properly, but restore to empty dir looks like this:
I think you can ignore the extra "See 'influx query -h' for help", it's the access that's the issue. I checked the bolt file MD5 sum before and after restore, and it looks identical in both scenarios. I've reproduced this error twice. Please take a look Monday. |
@jacobmarble I think the problem is the credentials aren't part of this backup/restore process. I got the same, but restored it to working by copying the credentials back in. |
@jacobmarble building idpe fails against this with:
Created https://github.com/influxdata/idpe/pull/5776 to hopefully fix that. |
96752f8
to
880570c
Compare
@jacobmarble latest commit should fix the bolt being copied to credentials issue. Problem with my testing was I was still using the token explicitly in queries which I didn't realize overrides whatever's in credentials, retested without it to verify and verified credentials files match before and after. |
Adds a restore tool which does offline restore of data and metadata.
Saves the credentials file to backups and restores it from backups. Additionally adds some logging for errors when fetching backup files.
758d7b4
to
f9fbbb3
Compare
f9fbbb3
to
1659f68
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is great, a couple of small nits included but one major question:
Why do we perform os.MkdirAll
with 0777
permissions? That seems way too open for my liking, could we make do with 0755
instead? Do we truly need these files to be read/write/execute enable for other
?
I scanned the code to figure out what we currently do. In the storage engine, 0777 and 0666 is very common, and in #5171 @benbjohnson argues that the user of InfluxDB can |
Thanks for that @jacobmarble, appreciate the history on this. I'm fine with the changes as long as you are OK with that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Closes #15603
Closes #15604
Closes #15605
Closes #15606
Implements online backup and offline restore.
To test functionality it was necessary to combine #15558 and #16352 into one PR based on recent master/HEAD. Then:
influx backup
influxd restore
to existing database directoryinfluxd restore
to empty database directoryCheck before merging:
influxd restore
to empty database directory" fails