Bug 970914 - Mysql big data snapshot restore failed
Summary: Mysql big data snapshot restore failed
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Fotios Lindiakos
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks: 978344
TreeView+ depends on / blocked
 
Reported: 2013-06-05 08:16 UTC by nsun
Modified: 2015-05-14 23:20 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 978344 (view as bug list)
Environment:
Last Closed: 2013-06-24 14:51:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description nsun 2013-06-05 08:16:10 UTC
Description of problem:
Snapshot save big data(500000 rows) and restored it. Then there will be no data in mysql.

Version-Release number of selected component (if applicable):
Devenv_3319

How reproducible:
always

Steps to Reproduce:
1. create an php app and embed mysql cartridge to it
# rhc app create php php-5.3 -predhat
# rhc cartridge add mysql-5.1 -a php -predhat
2.ssh longin app ,create tables 'info'
# ssh 51aedd014c83d2073f000001.rhcloud.com
>mysql 
>use php
> CREATE TABLE IF NOT EXISTS info(id INT NOT NULL AUTO_INCREMENT, datt
a CHAR(200), PRIMARY KEY (id));
3. use script insert 500000 rows data to table 'info'
while (i<500000);do
    mysql  -Dphp -e "INSERT INTO info VALUES(NULL, 'This is testing data for testing snapshoting and restoring big data in mysql database.');"
done
4. Snapshot save app
# rhc snapshot save php -predhat
5. Login mysql from app's cartridge , delete info table
# ssh 51aedd014c83d2073f000001.rhcloud.com
>mysql -Dphp -e "drop table info"
6. Snapshot restore app
#rhc snapshot restore app -f php.tar.gz -predhat
7. Login mysql to check if the data is restored

Actual results:
table 'info' have not found.

Expected results:
Table restore should be successed,and 500000 rows data existed in mysql

Additional info:
I tried write 10 rows data to mysql, snapshot save and restore is successed

Comment 1 Fotios Lindiakos 2013-06-18 20:28:08 UTC
I am trying to reproduce this. This script will create the data quicker because it's only making a single mysql call.

ruby -e "1000000.times{puts 'INSERT INTO info VALUES(NULL,\'This is testing data for testing snapshoting and restoring big data in mysql database.\');'}" > /tmp/insert.sql && mysql -D $OPENSHIFT_APP_NAME < /tmp/insert.sql

Comment 2 Fotios Lindiakos 2013-06-18 21:17:03 UTC
I've modified the mysql dump to be a little smaller using --extended-insert as well as speeding up the restore by turning off autocommit and some data checks. This is working in my manual testing. I will run the extended database tests and then submit a pull request.

Comment 3 Fotios Lindiakos 2013-06-18 22:50:03 UTC
Testing this PR now: https://github.com/openshift/origin-server/pull/2891

Comment 4 Fotios Lindiakos 2013-06-19 00:15:36 UTC
PR is currently merging, should be available for testing shortly

Comment 5 openshift-github-bot 2013-06-19 01:28:00 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/24fbcce38965191489916c30736927300350eeca
Bug 970914 - Mysql big data snapshot restore failed

Comment 6 nsun 2013-06-19 08:22:00 UTC
Verfied on devenv_3383.


Note You need to log in before you can comment on or make changes to this bug.