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

restore multiple time series database backup and result was messed up #9796

Open
HeathKang opened this Issue May 2, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@HeathKang
Copy link

HeathKang commented May 2, 2018

Hi,
I had backup multiple time series database(Influxdb 1.2.0) when disk is full. Like 2017-06-02 -- 2018-01-23; 2018-01-24 -- 2018-04-15. Then I try to restore those time series backups to one influxdb database(Influxdb 1.5.2), but the result was messed. I use 2018-04-15 backup meta.00, then I can't get the all data before 2018-01-24. I use 2018-01-23 meta, I can't get all data after 2018-01-24.
So i think the meta was not restore properly.What should I do when I restore multiple databackup in different time series?

@HeathKang

This comment has been minimized.

Copy link
Author

HeathKang commented May 2, 2018

Update:
I had drop old data every time after backup old data and old meta, maybe the latest meta didn't contain the old data shard information and old meta didn't contain the latest shard information. So i can't query all the data when I restore all the backups. This is my guess.

@dgnorton

This comment has been minimized.

Copy link
Contributor

dgnorton commented May 3, 2018

@HeathKang Can you post the commands you're using for backup and restore?

@HeathKang

This comment has been minimized.

Copy link
Author

HeathKang commented May 4, 2018

Thanks for your reply.
I had four backups backup_20180415, backup_20180226, backup_20180212, backup_20180123, then I restored four backups to one influxdb database by thoese commands:

influxd restore -metadir /influxdb/meta/ /backup_20180415/meta/
influxd restore -database -datadir /influxdb/data/ /backup_20180415/data/

influxd restore -metadir /influxdb/meta/ /backup_20180226/meta/
influxd restore -database -datadir /influxdb/data/ /backup_20180226/data/

influxd restore -metadir /influxdb/meta/ /backup_20180212/meta/
influxd restore -database -datadir /influxdb/data/ /backup_20180212/data/

influxd restore -metadir /influxdb/meta/ /backup_20180123/meta/
influxd restore -database -datadir /influxdb/data/ /backup_20180123/data/

And after this, I got data loss. But if I restore four backups on four influxdb location.

influxd restore -metadir /influxdb_0415/meta/ /backup_20180415/meta/
influxd restore -database -datadir /influxdb_0415/data/ /backup_20180415/data/

influxd restore -metadir /influxdb_0226/meta/ /backup_20180226/meta/
influxd restore -database -datadir /influxdb_0226/data/ /backup_20180226/data/

influxd restore -metadir /influxdb_0212/meta/ /backup_20180212/meta/
influxd restore -database -datadir /influxdb_0212/data/ /backup_20180212/data/

influxd restore -metadir /influxdb_0123/meta/ /backup_20180123/meta/
influxd restore -database -datadir /influxdb_0123/data/ /backup_20180123/data/

I can query all data by changing influxdb.conf meta, data, wal location.
And I had test restore different meta backup in /influxdb/meta like:

influxd restore -metadir /influxdb/meta/ /backup_20180415/meta/

influxd restore -metadir /influxdb/meta/ /backup_20180226/meta/

influxd restore -metadir /influxdb/meta/ /backup_20180212/meta/

influxd restore -metadir /influxdb/meta/ /backup_20180123/meta/

I got different data loss when I restored different meta backup. So I guess maybe meta was not merged well result in data loss.

@dgnorton dgnorton added the 1.x label Jan 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment