Use Perl DBD::MySQL for server communication in innobackupex
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
- Status:
- Complete
- Approver:
- Alexey Kopytov
- Priority:
- Medium
- Drafter:
- Alexey Kopytov
- Direction:
- Needs approval
- Assignee:
- Alexey Kopytov
- Definition:
- Approved
- Series goal:
- Accepted for 2.1
- Implementation:
-
Implemented
- Milestone target:
-
2.1.0-alpha1
- Started by
- Alexey Kopytov
- Completed by
- Alexey Kopytov
Related branches
Related bugs
Bug #1095551: Unnecessary long sleep() in innobackupex leads to FTWRL taking too long | Fix Released |
Sprints
Whiteboard
Work Items
Dependency tree

* Blueprints in grey have been implemented.