Closed nwbreneman closed 5 years ago
Passive vs. active sounds more logically like a client attribute than a separate object to me so I am going to merge these.
On Tue, Dec 11, 2018 at 10:47 AM soulen3 notifications@github.com wrote:
@soulen3 commented on this pull request.
In plugins/holland.lib.mysql/holland/lib/mysql/client/base.py https://github.com/holland-backup/holland/pull/250#discussion_r240742900 :
@@ -444,6 +445,7 @@ class PassiveMySQLClient(MySQLClient): the connect method is called"""
def __init__(self, *args, **kwargs):
- super(PassiveMySQLClient, self).init(*args, **kwargs)
This is causing a problem in the holland.backup.mysql_lvm plugin.
holland bk
Holland 1.1.9 started with pid 17521 --- Starting backup run --- Creating backup path /var/spool/holland/default/20181211_183704 Estimating size of mysqldump backup Estimated Backup Size: 641.04KB Using Historic Space Estimate: Checking for information in /var/spool/holland/default/newest/backup.conf Last backup used 165.98KB Adjusting estimated size to last backup total * 1.1: 182.58KB Starting backup[default/20181211_183704] via plugin mysqldump-lvm Backing up /var/lib/mysql via snapshot Auto-sizing snapshot-size to 1.00GB (256 extents) Saving mysqld log file to /var/spool/holland/default/20181211_183704/holland_lvm.log Acquiring read-lock and flushing tables This MySQL server does not have binary logs enabled. Nothing to record from SHOW MASTER STATUS. This MySQL server is not a slave. Nothing to record from SHOW SLAVE STATUS Created snapshot volume /dev/data/mysql_snapshot Releasing read-lock Mounted /dev/data/mysql_snapshot on /tmp/tmp5Hmqgc Handing-off to mysqldump plugin Starting /usr/libexec/mysqld --defaults-file=/tmp/tmp5Hmqgc/my.bootstrap.cnf Waiting for /usr/libexec/mysqld to start Stopping /usr/libexec/mysqld Waiting for MySQL to stop /usr/libexec/mysqld stopped Unmounting snapshot /dev/data/mysql_snapshot on cleanup Removed snapshot /dev/data/mysql_snapshot on cleanup Removing temporary mountpoint /tmp/tmp5Hmqgc <holland.backup.mysql_lvm.actions.mysql.mysqldump.MySQLDumpDispatchAction object at 0x7f32102be6d0>: (2002, "Can't connect to local MySQL server through socket '/tmp/tmp5Hmqgc/holland_mysqldump.sock' (2)") Error occurred during snapshot process. Aborting. Backup failed after 0.46 seconds auto-purge-failures not enabled. Failed backup not purged. Backup failed: Failed backup: default Released lock /etc/holland/backupsets/default.conf --- Ending backup run ---
This appears to be calling the MySQLClient.init function, which creates a connection to the database. This connection fails in the mysql_lvm plugin because the secondary database hasn't been finished starting yet.
I believe the expected behavior is that MySQLClient will create a database connection when it's initialized and PassiveMySQLClient will not. I don't think we need this functionality though. All of the plugins are using the connect function to normalize the database client arguments, and I don't see the MySQLClient class used anywhere else. So we should be able set self._connection to None in MySQLClient.init, or combine the PassiveMySQLClient and MySQLClient class into a single class.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/holland-backup/holland/pull/250#pullrequestreview-183843297, or mute the thread https://github.com/notifications/unsubscribe-auth/AHehj8W6PGL6OwInKKPfcCuzq9552ip5ks5u3_3AgaJpZM4ZMYhV .
@soulen3 merged those classes -- tested that xtrabackup is working now if you want to verify.
Don't lint tests. Only lint for >= Python 2.7 as pylint is unsupported from pip for 2.6. Ignores some Python 3 specific lint warnings and common false-positive messages for import issues. Use specific mysqlclient version from pip for Python 2.6 compatability.