← Back to team overview

maria-developers team mailing list archive

MDEV-7502 Automatic provisioning of slave – retrieval of data from master

 

Hello Kristian,
after master-slave connection part, I proceeded to retrieval of data
from master. There are two types of data which provisioning master
will have to send, meta-data and row data.

Meta-data
For this I found only one method, pass output of SHOW CREATE * to
slave in 'Query_log_event'. When I was looking for alternatives, I
have found MySQL online backup work log where they are describing
similar/same problem under High Level Architecture – Decision (
http://dev.mysql.com/worklog/task/?id=3574 ). Because of this, I find
it unlikely, that there currently is better way.
Because meta-data retrieval will take only small fraction of
provisioning time, I think, that it could be implemented using
'Ed_connection' class, it executes query in string form and returns
result set from within replication thread. Disadvantage of this
solution is that query has to go through parser and all steps of
generic execution, but on the other hand resulting code will be more
independent from exact implementations, their pre-conditions and won’t
contain any logical mistakes (locking, etc).

Row data
For this, same method with 'Ed_connection' could work, but it would be
probably too big overhead – parser, result processing. So I created
low level loop which goes through records of table and fills them in
'Write_rows_log_event'. Could you please check it, if it looks
acceptable and I will then rewrite it to generic form, it is
provisioning_send_info::send_table_data() function.
https://github.com/f4rnham/server/blob/3d36cbfc20dff73d92ce61168dcc9805d68d3e2b/sql/rpl_provisioning.cc
Right now it is working as expected on small test case. It goes
through whole table at once and creates multiple row events when one
would be enough.

The same file also contains test of 'Ed_connection' and test of slave
being able to receive and process 'Query_log_event'.

Thanks for advice, Martin.


Follow ups