Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 970914 - Mysql big data snapshot restore failed
Mysql big data snapshot restore failed
Product: OpenShift Online
Classification: Red Hat
Component: Containers (Show other bugs)
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Fotios Lindiakos
libra bugs
Depends On:
Blocks: 978344
  Show dependency treegraph
Reported: 2013-06-05 04:16 EDT by nsun
Modified: 2015-05-14 19:20 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 978344 (view as bug list)
Last Closed: 2013-06-24 10:51:00 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description nsun 2013-06-05 04:16:10 EDT
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):

How reproducible:

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@phpbigmysqldqw8-sun000.dev.rhcloud.com
>use php
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.');"
4. Snapshot save app
# rhc snapshot save php -predhat
5. Login mysql from app's cartridge , delete info table
# ssh 51aedd014c83d2073f000001@phpbigmysqldqw8-sun000.dev.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 16:28:08 EDT
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 17:17:03 EDT
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 18:50:03 EDT
Testing this PR now: https://github.com/openshift/origin-server/pull/2891
Comment 4 Fotios Lindiakos 2013-06-18 20:15:36 EDT
PR is currently merging, should be available for testing shortly
Comment 5 openshift-github-bot 2013-06-18 21:28:00 EDT
Commit pushed to master at https://github.com/openshift/origin-server

Bug 970914 - Mysql big data snapshot restore failed
Comment 6 nsun 2013-06-19 04:22:00 EDT
Verfied on devenv_3383.

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