Use Perl DBD::MySQL for server communication in innobackupex

Registered by Alexey Kopytov

Currently innobackupex uses an extremely cumbersome and error-prone way to communicate with the server. It spawns the mysql command line client in a separate process with stdout and stderr redirected to temporary files. SQL statements are then sent to stdin of the process. Error detection is implemented via stderr parsing, and query result fetching via stdout parsing.

The only reason for implementing it this way was probably to avoid dependencies on Perl's native database communication facilities which are normally packages separately and not installed by default. However, it still introduces a dependency on the command line client.

This approach also has a number of serious drawbacks:

- handling database communication in a separate process is asynchronous, whereas in all cases innobackupex actually needs synchronous communication (i.e. does not proceed until a previously issued query is executed by the server)

- synchronization with the external process requires polling with sleeps to avoid tight loops. Which results in unnecessary delays, sometimes resulting in a longer FTWRL time, see bug #1095551.

- there can only be one 'user' of the database connection. Any attempt to implement multiple concurrent threads/processes communicating with the server would result in even more cumbersome implementation

- both error detection and results fetching implemeted via parsing command line client's responses are fragile, e.g. too easy to confuse which response corresponds to which previously executed query.

The purpose of this task is to replace the database communication code in innobackupex with Perl's native interface, i.e.. DBI + DBD::MySQL.

Blueprint information

Alexey Kopytov
Alexey Kopytov
Needs approval
Alexey Kopytov
Series goal:
Accepted for 2.1
Milestone target:
milestone icon 2.1.0-alpha1
Started by
Alexey Kopytov
Completed by
Alexey Kopytov



Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.


No subscribers.