Skip to content
This repository has been archived by the owner on May 9, 2023. It is now read-only.

autoxtrabackup --prepare - Select option 3 without preparing backup #158

Closed
Komport opened this issue Nov 2, 2017 · 18 comments
Closed

autoxtrabackup --prepare - Select option 3 without preparing backup #158

Komport opened this issue Nov 2, 2017 · 18 comments

Comments

@Komport
Copy link
Contributor

Komport commented Nov 2, 2017

Hi.
I have little confusion with option 3 in prepare. May be it is the way it should be. But I hope you will clarify.

To reproduce.

Existing databases

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
| test               |
+--------------------+

Take first backup

autoxtrabackup --backup

Create new DB

mysql> create database test1;
Query OK, 1 row affected (0.00 sec)

Take backup again

[root@server1 2017-11-03_00-31-49]# autoxtrabackup --backup
mysqladmin: [Warning] Using a password on the command line interface can be insecure.

Drop database

mysql> drop database test1;
Query OK, 0 rows affected (0.37 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
| test               |
+--------------------+
5 rows in set (0.23 sec)

And run autoxtrabackup as below.

mysql> drop database test1;
Query OK, 0 rows affected (0.37 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
| test               |
+--------------------+
5 rows in set (0.23 sec)

This procedure will finish with success. Mysql will stop and start. But when i check databases test1 database not there. What will 3 option do in case of no prepared backups?

mysql> show databases;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    3
Current database: *** NONE ***

+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
| test               |
+--------------------+
5 rows in set (0.11 sec)
@ShahriyarR
Copy link
Owner

Hi, could you please repeat the process with following command?
autoxtrabackup -v -l DEBUG

I am curious about output of running commands.

@ShahriyarR
Copy link
Owner

Oh, now got your question.
The thing is, maybe I have prepared backup 1 hour ago and now want to copy-back.
So it is going to copy-back already prepared backup.

@Komport
Copy link
Contributor Author

Komport commented Nov 2, 2017

You can find output as below.

[root@server1 2017-11-03_00-31-49]# autoxtrabackup --prepare -v -l DEBUG
2017-11-03 00:59:38 DEBUG    <pid.PidFile object at 0x7fde7cface08> entering setup
2017-11-03 00:59:38 DEBUG    <pid.PidFile object at 0x7fde7cface08> create pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.pid
2017-11-03 00:59:38 DEBUG    <pid.PidFile object at 0x7fde7cface08> check pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.pid
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

Preparing full/inc backups!
What do you want to do?
1. Prepare Backups and keep for future usage. NOTE('Once Prepared Backups Can not be prepared Again')
2. Prepare Backups and restore/recover/copy-back immediately
3. Just copy-back previously prepared backups
Please Choose one of options and type 1 or 2 or 3: 3

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
2017-11-03 00:59:42 DEBUG    ####################################################################################################
2017-11-03 00:59:42 DEBUG    Shutting Down MySQL server: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#
2017-11-03 00:59:42 DEBUG    ####################################################################################################
2017-11-03 00:59:49 DEBUG    
2017-11-03 00:59:49 DEBUG    ####################################################################################################
2017-11-03 00:59:49 DEBUG    Moving MySQL datadir to /home/shahriyar.rzaev/XB_TEST/mysql_datadirs  - - - - - - - - - - - - - - - - - - - - - - - - - - - -#
2017-11-03 00:59:49 DEBUG    ####################################################################################################
2017-11-03 00:59:52 DEBUG    Emptied /home/shahriyar.rzaev/XB_TEST/mysql_datadirs directory ...
2017-11-03 00:59:56 DEBUG    Moved datadir to /home/shahriyar.rzaev/XB_TEST/mysql_datadirs ...
2017-11-03 00:59:56 DEBUG    Creating an empty data directory ...
2017-11-03 00:59:56 DEBUG    Datadir is Created! ...
2017-11-03 00:59:56 DEBUG    ####################################################################################################
2017-11-03 00:59:56 DEBUG    Copying Back Already Prepared Final Backup: - - - - - - - - - - - - - - - - - - - - - - - - - - - -#
2017-11-03 00:59:56 DEBUG    ####################################################################################################
2017-11-03 01:00:04 DEBUG    ####################################################################################################
2017-11-03 01:00:04 DEBUG    Data copied back successfully! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
2017-11-03 01:00:04 DEBUG    ####################################################################################################
2017-11-03 01:00:07 DEBUG    ####################################################################################################
2017-11-03 01:00:07 DEBUG    New copied-back data now owned by specified user! - - - - - - - - - - - - - - - - - - - - - - - - - - -#
2017-11-03 01:00:07 DEBUG    ####################################################################################################
2017-11-03 01:00:07 DEBUG    ####################################################################################################
2017-11-03 01:00:07 DEBUG    Starting MySQL/MariaDB server: 
2017-11-03 01:00:07 DEBUG    ####################################################################################################
2017-11-03 01:00:19 DEBUG    Starting MySQL ...
2017-11-03 01:00:19 DEBUG    
2017-11-03 01:00:19 DEBUG    ####################################################################################################
2017-11-03 01:00:19 DEBUG    All data copied back successfully. 
2017-11-03 01:00:19 DEBUG    Your MySQL server is UP again
2017-11-03 01:00:19 DEBUG    ####################################################################################################
2017-11-03 01:00:19 DEBUG    <pid.PidFile object at 0x7fde7cface08> closing pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.pid
2017-11-03 01:00:19 DEBUG    <pid.PidFile object at 0x7fde7cface08> closing pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.pid

@Komport
Copy link
Contributor Author

Komport commented Nov 2, 2017

Another test case with empty backupdir.

[root@server1 backup_dir]# autoxtrabackup --prepare -v -l DEBUG
2017-11-03 01:03:08 DEBUG    <pid.PidFile object at 0x7f2d1b6cde08> entering setup
2017-11-03 01:03:08 DEBUG    <pid.PidFile object at 0x7f2d1b6cde08> create pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.pid
2017-11-03 01:03:08 DEBUG    <pid.PidFile object at 0x7f2d1b6cde08> check pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.pid
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

Preparing full/inc backups!
What do you want to do?
1. Prepare Backups and keep for future usage. NOTE('Once Prepared Backups Can not be prepared Again')
2. Prepare Backups and restore/recover/copy-back immediately
3. Just copy-back previously prepared backups
Please Choose one of options and type 1 or 2 or 3: 3

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
2017-11-03 01:03:13 DEBUG    ####################################################################################################
2017-11-03 01:03:13 DEBUG    Shutting Down MySQL server: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#
2017-11-03 01:03:13 DEBUG    ####################################################################################################
2017-11-03 01:03:20 DEBUG    
2017-11-03 01:03:20 DEBUG    ####################################################################################################
2017-11-03 01:03:20 DEBUG    Moving MySQL datadir to /home/shahriyar.rzaev/XB_TEST/mysql_datadirs  - - - - - - - - - - - - - - - - - - - - - - - - - - - -#
2017-11-03 01:03:20 DEBUG    ####################################################################################################
2017-11-03 01:03:23 DEBUG    Emptied /home/shahriyar.rzaev/XB_TEST/mysql_datadirs directory ...
2017-11-03 01:03:25 DEBUG    Moved datadir to /home/shahriyar.rzaev/XB_TEST/mysql_datadirs ...
2017-11-03 01:03:25 DEBUG    Creating an empty data directory ...
2017-11-03 01:03:25 DEBUG    Datadir is Created! ...
2017-11-03 01:03:25 DEBUG    ####################################################################################################
2017-11-03 01:03:25 DEBUG    Copying Back Already Prepared Final Backup: - - - - - - - - - - - - - - - - - - - - - - - - - - - -#
2017-11-03 01:03:25 DEBUG    ####################################################################################################
2017-11-03 01:03:29 ERROR    Error occurred while copying back data!
2017-11-03 01:03:29 ERROR    /usr/bin/xtrabackup version 2.4.8 based on MySQL server 5.7.13 Linux (x86_64) (revision id: 97330f7)
xtrabackup: Can't change dir to '/home/shahriyar.rzaev/XB_TEST/backup_dir/full/0/' (Errcode: 2 - No such file or directory)
cannot my_setwd /home/shahriyar.rzaev/XB_TEST/backup_dir/full/0/
2017-11-03 01:03:29 ERROR    Error Occurred!
2017-11-03 01:03:29 DEBUG    <pid.PidFile object at 0x7f2d1b6cde08> closing pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.pid
2017-11-03 01:03:29 DEBUG    <pid.PidFile object at 0x7f2d1b6cde08> closing pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.pid
[root@server1 backup_dir]# 

@ShahriyarR
Copy link
Owner

This thing seems to be interesting:

'/home/shahriyar.rzaev/XB_TEST/backup_dir/full/0/' -> I am curious where it took 0 here?

@Komport
Copy link
Contributor Author

Komport commented Nov 3, 2017

May be from here?

def recent_full_backup_file(self):
        # Return last full backup dir name

        if len(os.listdir(self.full_dir)) > 0:
            return max(os.listdir(self.full_dir))
        return 0

@ShahriyarR
Copy link
Owner

Yes, from our discussions I have concluded followings:

  • Prevent running/choosing option 3 if backups are not prepared
  • Prevent running if there is no backup

So confirmed as true bug.
Thank you very much.

@ShahriyarR
Copy link
Owner

I think here first of all, the best not to return 0 but raise a RuntimeError such as:

def recent_full_backup_file(self):
        # Return last full backup dir name

        if len(os.listdir(self.full_dir)) > 0:
            return max(os.listdir(self.full_dir))
        else:
            raise RuntimeError("The empty full backup directory")

After that handle in other places.

@ShahriyarR
Copy link
Owner

According to check if backup is prepared or not.
There is a file inside backup directory called xtrabackup_checkpoints. Which as backup_type column.
So in general we can check if it is equal to full-prepared, if yes then proceed. If not then raise an error.

$ cat xtrabackup_checkpoints
backup_type = full-prepared
from_lsn = 0
to_lsn = 2547842
last_lsn = 2547851
compact = 0
recover_binlog_info = 0

ShahriyarR added a commit that referenced this issue Nov 3, 2017
@ShahriyarR
Copy link
Owner

Results of test, if full backup directory is empty:

2017-11-03 11:31:15 DEBUG    <pid.PidFile object at 0x7f49b044b0e8> entering setup
2017-11-03 11:31:15 DEBUG    <pid.PidFile object at 0x7f49b044b0e8> create pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.pid
2017-11-03 11:31:15 DEBUG    <pid.PidFile object at 0x7f49b044b0e8> check pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.pid
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Preparing full/inc backups!
What do you want to do?
1. Prepare Backups and keep for future usage. NOTE('Once Prepared Backups Can not be prepared Again')
2. Prepare Backups and restore/recover/copy-back immediately
3. Just copy-back previously prepared backups
Please Choose one of options and type 1 or 2 or 3: 3
3

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2017-11-03 11:31:20 DEBUG    <pid.PidFile object at 0x7f49b044b0e8> closing pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.pid
Traceback (most recent call last):
  File "/home/shahriyar.rzaev/virtualenvs/py_3_5_3_autoxtrabackup/bin/autoxtrabackup", line 11, in <module>
    load_entry_point('mysql-autoxtrabackup==1.4.9', 'console_scripts', 'autoxtrabackup')()
  File "/home/shahriyar.rzaev/virtualenvs/py_3_5_3_autoxtrabackup/lib/python3.5/site-packages/click-6.7-py3.5.egg/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/shahriyar.rzaev/virtualenvs/py_3_5_3_autoxtrabackup/lib/python3.5/site-packages/click-6.7-py3.5.egg/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/shahriyar.rzaev/virtualenvs/py_3_5_3_autoxtrabackup/lib/python3.5/site-packages/click-6.7-py3.5.egg/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/shahriyar.rzaev/virtualenvs/py_3_5_3_autoxtrabackup/lib/python3.5/site-packages/click-6.7-py3.5.egg/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/shahriyar.rzaev/MySQL-AutoXtraBackup/autoxtrabackup.py", line 188, in all_procedure
    a.prepare_backup_and_copy_back()
  File "/home/shahriyar.rzaev/MySQL-AutoXtraBackup/backup_prepare/prepare.py", line 735, in prepare_backup_and_copy_back
    self.copy_back_action()
  File "/home/shahriyar.rzaev/MySQL-AutoXtraBackup/backup_prepare/prepare.py", line 696, in copy_back_action
    if self.check_if_backup_prepared(self.full_dir, self.recent_full_backup_file()):
  File "/home/shahriyar.rzaev/MySQL-AutoXtraBackup/backup_prepare/prepare.py", line 34, in recent_full_backup_file
    raise RuntimeError("The full backup directory is empty, it seems you have not backups")
RuntimeError: The full backup directory is empty, it seems you have not backups
2017-11-03 11:31:20 DEBUG    <pid.PidFile object at 0x7f49b044b0e8> closing pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.pid

@ShahriyarR
Copy link
Owner

If backup is not prepared:

2017-11-03 11:37:50 DEBUG    <pid.PidFile object at 0x7f7de0c7a0e8> entering setup
2017-11-03 11:37:50 DEBUG    <pid.PidFile object at 0x7f7de0c7a0e8> create pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.pid
2017-11-03 11:37:50 DEBUG    <pid.PidFile object at 0x7f7de0c7a0e8> check pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.pid
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Preparing full/inc backups!
What do you want to do?
1. Prepare Backups and keep for future usage. NOTE('Once Prepared Backups Can not be prepared Again')
2. Prepare Backups and restore/recover/copy-back immediately
3. Just copy-back previously prepared backups
Please Choose one of options and type 1 or 2 or 3: 3
3

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2017-11-03 11:37:55 ERROR    This full backup is not fully prepared, not doing copy-back!
2017-11-03 11:37:55 ERROR    Aborting!
2017-11-03 11:37:55 DEBUG    <pid.PidFile object at 0x7f7de0c7a0e8> closing pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.pid
Traceback (most recent call last):
  File "/home/shahriyar.rzaev/virtualenvs/py_3_5_3_autoxtrabackup/bin/autoxtrabackup", line 11, in <module>
    load_entry_point('mysql-autoxtrabackup==1.4.9', 'console_scripts', 'autoxtrabackup')()
  File "/home/shahriyar.rzaev/virtualenvs/py_3_5_3_autoxtrabackup/lib/python3.5/site-packages/click-6.7-py3.5.egg/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/shahriyar.rzaev/virtualenvs/py_3_5_3_autoxtrabackup/lib/python3.5/site-packages/click-6.7-py3.5.egg/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/shahriyar.rzaev/virtualenvs/py_3_5_3_autoxtrabackup/lib/python3.5/site-packages/click-6.7-py3.5.egg/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/shahriyar.rzaev/virtualenvs/py_3_5_3_autoxtrabackup/lib/python3.5/site-packages/click-6.7-py3.5.egg/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/shahriyar.rzaev/MySQL-AutoXtraBackup/autoxtrabackup.py", line 188, in all_procedure
    a.prepare_backup_and_copy_back()
  File "/home/shahriyar.rzaev/MySQL-AutoXtraBackup/backup_prepare/prepare.py", line 735, in prepare_backup_and_copy_back
    self.copy_back_action()
  File "/home/shahriyar.rzaev/MySQL-AutoXtraBackup/backup_prepare/prepare.py", line 696, in copy_back_action
    if self.check_if_backup_prepared(self.full_dir, self.recent_full_backup_file()):
  File "/home/shahriyar.rzaev/MySQL-AutoXtraBackup/backup_prepare/prepare.py", line 666, in check_if_backup_prepared
    raise RuntimeError("This full backup is not fully prepared, not doing copy-back!")
RuntimeError: This full backup is not fully prepared, not doing copy-back!
2017-11-03 11:37:55 DEBUG    <pid.PidFile object at 0x7f7de0c7a0e8> closing pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.pid

@ShahriyarR
Copy link
Owner

@Komport
Could you please test also?
The branch is bugfix_issue158

ShahriyarR added a commit that referenced this issue Nov 3, 2017
@ShahriyarR
Copy link
Owner

PR is created waiting for original report for any other problems on fix.

@Komport
Copy link
Contributor Author

Komport commented Nov 3, 2017

It is ok now. But, can we only throw an error message and not full trackback?

[root@server1 MySQL-AutoXtraBackup]# autoxtrabackup --prepare
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Preparing full/inc backups!
What do you want to do?
1. Prepare Backups and keep for future usage. NOTE('Once Prepared Backups Can not be prepared Again')
2. Prepare Backups and restore/recover/copy-back immediately
3. Just copy-back previously prepared backups
Please Choose one of options and type 1 or 2 or 3: 3

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Traceback (most recent call last):
  File "/opt/Python35/bin/autoxtrabackup", line 11, in <module>
    load_entry_point('mysql-autoxtrabackup==1.4.9', 'console_scripts', 'autoxtrabackup')()
  File "/opt/Python35/lib/python3.5/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/opt/Python35/lib/python3.5/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/opt/Python35/lib/python3.5/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/Python35/lib/python3.5/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/opt/Python35/lib/python3.5/site-packages/mysql_autoxtrabackup-1.4.9-py3.5.egg/autoxtrabackup.py", line 188, in all_procedure
  File "/opt/Python35/lib/python3.5/site-packages/mysql_autoxtrabackup-1.4.9-py3.5.egg/backup_prepare/prepare.py", line 736, in prepare_backup_and_copy_back
  File "/opt/Python35/lib/python3.5/site-packages/mysql_autoxtrabackup-1.4.9-py3.5.egg/backup_prepare/prepare.py", line 697, in copy_back_action
  File "/opt/Python35/lib/python3.5/site-packages/mysql_autoxtrabackup-1.4.9-py3.5.egg/backup_prepare/prepare.py", line 35, in recent_full_backup_file
RuntimeError: The full backup directory is empty, it seems you have not backups

@ShahriyarR
Copy link
Owner

Sure, is it ok now?

2017-11-03 18:16:00 DEBUG    <pid.PidFile object at 0x7fa414368188> entering setup
2017-11-03 18:16:00 DEBUG    <pid.PidFile object at 0x7fa414368188> create pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.pid
2017-11-03 18:16:00 DEBUG    <pid.PidFile object at 0x7fa414368188> check pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.pid
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Preparing full/inc backups!
What do you want to do?
1. Prepare Backups and keep for future usage. NOTE('Once Prepared Backups Can not be prepared Again')
2. Prepare Backups and restore/recover/copy-back immediately
3. Just copy-back previously prepared backups
Please Choose one of options and type 1 or 2 or 3: 3
3

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2017-11-03 18:16:06 ERROR    RuntimeError: This full backup is not fully prepared, not doing copy-back!
2017-11-03 18:16:06 DEBUG    <pid.PidFile object at 0x7fa414368188> closing pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.pid
2017-11-03 18:16:06 DEBUG    <pid.PidFile object at 0x7fa414368188> closing pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.pid
2017-11-03 18:17:17 DEBUG    <pid.PidFile object at 0x7f6157493188> entering setup
2017-11-03 18:17:17 DEBUG    <pid.PidFile object at 0x7f6157493188> create pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.pid
2017-11-03 18:17:17 DEBUG    <pid.PidFile object at 0x7f6157493188> check pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.pid
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Preparing full/inc backups!
What do you want to do?
1. Prepare Backups and keep for future usage. NOTE('Once Prepared Backups Can not be prepared Again')
2. Prepare Backups and restore/recover/copy-back immediately
3. Just copy-back previously prepared backups
Please Choose one of options and type 1 or 2 or 3: 3
3

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2017-11-03 18:17:22 ERROR    RuntimeError: The full backup directory is empty, it seems you have not backups
2017-11-03 18:17:22 DEBUG    <pid.PidFile object at 0x7f6157493188> closing pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.pid
2017-11-03 18:17:22 DEBUG    <pid.PidFile object at 0x7f6157493188> closing pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.pid

@Komport
Copy link
Contributor Author

Komport commented Nov 3, 2017

Great 👍

@ShahriyarR
Copy link
Owner

Good, then it can be merged to release_v1.5.0 and it will be available on 1.5.0 version of autoxtrabackup

ShahriyarR pushed a commit that referenced this issue Nov 3, 2017
* Preliminary fix for issue #158

* Trying to fix, failed check

* Finalized the fix for issue #158

* Using try/except to catch exceptions

* Removed redundant logger.error messages

* Printing the RuntimError name
@ShahriyarR
Copy link
Owner

Merged.

ShahriyarR pushed a commit that referenced this issue Nov 16, 2017
* Bugfix issue144 (#146)

* Preliminary fix for issue #144

* Fixing option passing

* Opening the config file in w+ mode

* [ERROR] --gtid-mode=ON or UPGRADE_STEP_1 or UPGRADE_STEP_2 requires --log-bin and --log-slave-updates

* Preliminary fix for issue #144

* Added slave_count option to config generator

* Changd start_mysql_func() to accept start tool as well

* First test run

* TypeError: prepare_start_slave_options() missing 2 required positional arguments: 'basedir' and 'slave_number'

* TypeError: prepare_start_slave_options() missing 1 required positional argument: 'slave_number'

* [ERROR] The socket file path is too long (> 107): /home/shahriyar.rzaev/XB_TEST/server_dir/PS231017-percona-server-5.6.37-82.2-linux-x86_64-debug/node0/slave_socket.sock

* Now trying to fix slave start up problem

* Added few tests and also pt-table-checksum run

* Added assert statement

* Trying to make started server to be slave

* Added unit test test_run_change_master()

* Added returns to method

* Trying to fix sql error

* Trying to fix sql error again

* Trying to escape characters

* Escaping some characters here also

* Checking again for failed thing

* Passing master port for slave's change master statement

* Fixed port checking call

* Found the value of port

* Passing port number to change master statement

* Trying to pass proper create statement

* Passed true values for master server

* Fix the string

* Successfully made the started node as slave

* Added run for pt-table-checksum tool on master

* Trying to run pt-table-checksum on master server

* TypeError: 'int' object is not iterable

* Fixing some dependent tasks

* Passing start slave command to slave server

* Trying to fix this weird situation on returning True from method

* Check if prepare methods also returning something

* returning True from functions

* Changed the structure of run_change_master()

* Raising RuntimeError here

* Added new check_slave_output() static method

* Fixing open issue for stop_node{} file

* Added sleep(10)

* Fixing small things

* Giving some sleep(10)

* Added new debug message

* Added few mor fixes here

* Added drop_blank_mysql_users() static method

* Trying to fix failed test

* Again trying to fix failed test sql syntax error

* Next attempt

* next attempt n2

* seems to be final attempt

* Finalized dropping blank users

* Added final docstrings and other checks

* Changed binlog_format to row

* Added get_gtid_address() static method

* Running gtid_purged

* RuntimeError: Failed to run SQL command -> ERROR 1193 (HY000) at line 1: Unknown system variable 'gitd_purged'

* Increased the sleep time

* Added pytest for check_slave_status()

* Could find the fail reason. it was due to not using lstrip()

* Changed assert to check against None

* Added new tests and create_dsns_table()

* Creating table

* Added pytest test_populate_dsns_table()

* Fix for failed mysql client command

* for the right syntax to use near 's=/home/shahriyar.rzaev/XB_TEST/server_dir/PS231017-percona-server-5.6.37-82.2-l' at line 1

* Another sql syntax error

* Adding some fix for sql syntax

* Again trying to fix sql syntax issue

* Added --recursion-method

* Added pytest test_run_pt_table_checksum()

* Using localhost instead of ip

* removed p=

* Passing slave port

* changed to 127.0.0.1

* Finalizing the #144 implementation

* Bugfix issue147 (#148)

* Adding log file support

* Adding handlers.RotateFileHandler usage

* Bugfix issue150 (#153)

* Preliminary fix for issue #150 changed CheckEnv class

* Pushing some other changes now.

* Added much more things here

* Finalizing the issue #150

* Preliminary fix for issue #152 (#155)

* Preliminary fix for issue #151 (#156)

* Bugfix issue157 (#159)

* Preliminary fix for issue #157

* Added shutdown call for slave

* Bugfix issue158 (#161)

* Preliminary fix for issue #158

* Trying to fix, failed check

* Finalized the fix for issue #158

* Using try/except to catch exceptions

* Removed redundant logger.error messages

* Printing the RuntimError name

* Bugfix issue162 (#165)

* Preliminary fix for issue #162

* Checking failed thing

* Commenting for test purposes

* removed comments

* Commenting the function

* Uncommented

* Checking something here

* Passing ctx

* Trying to figure out something

* Removed help and version

* Added few other things

* Printed message

* Calling click.help_option()

* Ugly way of implementing --help

* reverted the changes

* Added print_help() wrapper

* Changed print_help

* Added some code

* Now it must be fixed

* changed a bit

* Eliminated options with default values

* using show_default inside option

* Changing some options

* Finalizing the issue fix

* Bugfix issue166 (#167)

* Preliminary fix for issue #166

* changed setup.py

* Added file name

* Changed back

* Changed a bit

* Changed to print() statement

* Using sys.exit()

* Bugfix issue168 (#169)

* Preliminary fix for issue #168

* The fix for partial.py file

* Fixing partial.py issue

* preliminary fix for issue #170 (#173)

* Bugfix issue163 (#174)

* Preliminary fix for issue #163

* TypeError: add_tag() missing 1 required positional argument: 'tag_string'

* Changed the type column

* changed the open mode

* Changed full_backup() and added pytest test

* Changed inc_backup() and added pytest test

* prepared test_inc_backup() test

* Added the tag passing facilities to autoxtrabackup

* Changed the sequence of input for backup_tags.txt

* Removing quotes for status value

* Bugfix issue164 (#175)

* Preliminary fix for issue #164

* Calling from CLI

* Trying to print the output in a good way

* Adding some extra strings

* Trying to fix something

* Hard coding the output

* Adding error message if there is no backup_tags.txt

* Changed the print message a bit

* Bugfix issue171 (#178)

* Preliminary fix for issue #171

* passing basedir path

* Failed with PS 5.6

* Added run_sql_stetement()

* Passing correct SQL

* Trying to figure out the fail reason

* passing --keyring-file-data to xtrabackup

* Added flush tables statement

* Added sleep statement here

* Bugfix issue172 (#180)

* Preliminary fix for issue #172

* Get the output for SQL

* Adding optimize table running

* Disabling the compression support due to bug 1641745

* Bugfix issue176 (#181)

* Preliminary fix for issue #176

* Passing tag to Prepare class from autoxtrabackup

* Fix for issue related to iteration

* Preliminary fix for issue #182 (#183)

* Bugfix issue185 (#186)

* Preliminary fix for issue #185

* Finalizing the fix

* Bugfix issue188 (#189)

* Preliminary fix for issue #188

* Again updating VagrantFile

* Introducing huge changes

* Committing some few changes as well

* decreasing the --parallel=10 to 1 for PS 5.7

* Committing few other changes

* Committing another change

* Fixing config generation

* Fixing path name

* Trying to finalize bug fix for issue #188

* changing to vagrant:vagrant

* Fixing small issue

* Fixing failed sql statement

* Now finished for sure :)

* Added another sleep(5)

* Increased random number range

* Finalized, can be merged to release_v_1.5.0

* Bugfix issue190 (#191)

* Preliminary fix for issue #190

* Fixing missing thing

* Disabling this features

* Preliminary fix for issue #149 (#160)

* Preliminary fix for issue #149

* Final review for v1.5.0 release

* Version bump
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants